Skip to main content

Interface: SubEventInterface<SenderType, DataType>

An event which can be emitted with optional data to subscribers.

Type parameters

Name
SenderType
DataType

Implemented by

Methods

clear

clear(): void

Clears all subscriptions to this event.

Returns

void

Defined in

src/sdk/sub/SubEvent.ts:32


notify

notify(sender, data): void

Emits an event to subscribers.

Parameters

NameTypeDescription
senderSenderTypeThe source of the event.
dataDataTypeData associated with the event.

Returns

void

Defined in

src/sdk/sub/SubEvent.ts:39


off

off(handler): void

Unsubscribes a callback function from this event.

Parameters

NameTypeDescription
handler(sender: SenderType, data: DataType) => voidThe function to unsubscribe.

Returns

void

Deprecated

This method has been deprecated in favor of using the Subscription object returned by .on() to manage subscriptions.

Defined in

src/sdk/sub/SubEvent.ts:27


on

on(handler, paused?): Subscription

Subscribes to this event.

Parameters

NameTypeDescription
handler(sender: SenderType, data: DataType) => voidA function to be called when an event is emitted.
paused?booleanWhether the new subscription should be initialized as paused. Defaults to false.

Returns

Subscription

The new subscription.

Defined in

src/sdk/sub/SubEvent.ts:19