Interface: SubEventInterface<SenderType, DataType>
Defined in: src/sdk/sub/SubEvent.ts:12
An event which can be emitted with optional data to subscribers.
Type Parameters
Type Parameter |
---|
SenderType |
DataType |
Methods
clear()
clear():
void
Defined in: src/sdk/sub/SubEvent.ts:24
Clears all subscriptions to this event.
Returns
void
notify()
notify(
sender
,data
):void
Defined in: src/sdk/sub/SubEvent.ts:31
Emits an event to subscribers.
Parameters
Parameter | Type | Description |
---|---|---|
sender | SenderType | The source of the event. |
data | DataType | Data associated with the event. |
Returns
void
on()
on(
handler
,paused?
):Subscription
Defined in: src/sdk/sub/SubEvent.ts:19
Subscribes to this event.
Parameters
Parameter | Type | Description |
---|---|---|
handler | (sender , data ) => void | A function to be called when an event is emitted. |
paused? | boolean | Whether the new subscription should be initialized as paused. Defaults to false . |
Returns
The new subscription.