Skip to main content

Interface: IEventEmitter

api.IEventEmitter

Interface describing event emitter members.

Implemented by#

Methods#

off#

â–¸ off<T>(type, handler): void

Unsubscribe from an event by its name.

Type parameters#

Name
T

Parameters#

NameTypeDescription
typestringThe name of the event to unsubscribe from.
handler(event: T) => voidThe handler to remove.

Returns#

void

Defined in#

util/interfaces/IEventEmitter.ts:19


on#

â–¸ on<T>(type, handler): void

Subscribe to an event by its name.

Type parameters#

Name
T

Parameters#

NameTypeDescription
typestringThe name of the event to subscribe to.
handler(event: T) => voidThe handler called when the event occurs.

Returns#

void

Defined in#

util/interfaces/IEventEmitter.ts:30