Class: SubEvent<SenderType, DataType>
Defined in: src/sdk/sub/SubEvent.ts:47
An implementation of SubEventInterface.
Type Parameters
Type Parameter |
---|
SenderType |
DataType |
Implements
SubEventInterface
<SenderType
,DataType
>
Constructors
Constructor
new SubEvent<
SenderType
,DataType
>():SubEvent
<SenderType
,DataType
>
Returns
SubEvent
<SenderType
, DataType
>
Methods
clear()
clear():
void
Defined in: src/sdk/sub/SubEvent.ts:66
Clears all subscriptions to this event.
Returns
void
Implementation of
notify()
notify(
sender
,data
):void
Defined in: src/sdk/sub/SubEvent.ts:79
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
Implementation of
on()
on(
handler
,paused
):Subscription
Defined in: src/sdk/sub/SubEvent.ts:54
Subscribes to this event.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
handler | (sender , data ) => void | undefined | A function to be called when an event is emitted. |
paused | boolean | false | Whether the new subscription should be initialized as paused. Defaults to false . |
Returns
The new subscription.