Creates a new LiveEventScope
instance.
A Fluid objects runtime instance, typically this.runtime
.
Optional. List of roles allowed to send events using this scope. You should use a second scope if you need mixed permission support.
List of roles allowed to send events through this scope.
List of roles allowed to send events through this scope.
The runtimes current client ID. This will be undefined
if the client is disconnected.
Un-registers a listener for a named event.
Type of event being listened for.
Name of event to un-register.
Function that was originally passed to onEvent()
.
Registers a listener for a named event.
Type of event to listen for.
Name of event to listen for.
Function to call when the named event is sent or received.
Sends an event to other event scope instances for the Fluid object.
Type of event to send.
Name of the event to send.
Optional. Partial event object to send. The ILiveEvent.name
,
ILiveEvent.timestamp
, and ILiveEvent.clientId
fields will be automatically populated prior to sending.
The full event, including ILiveEvent.name
,
ILiveEvent.timestamp
, and ILiveEvent.clientId
fields if known.
Generated using TypeDoc
Object responsible for sending and receiving live share events.
Live objects send and receive events using an event scope. Event scopes can be restricted to only receive events from clients with specific roles. Any events that are received from clients without an allowed role type will be ignored.
Event scopes are isolated on a per Fluid object basis. That means that two different Fluid objects using the same event names don't have to worry about collisions. Two event scopes within the same Fluid object, however, don't have any isolation. You can use multiple event scopes within the same FLuid object, you just need to be careful that they send different events.