Skip to main content

Class: EventEmitter

api.EventEmitter

Hierarchy#

Implements#

Constructors#

constructor#

• new EventEmitter()

Defined in#

util/EventEmitter.ts:6

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

Implementation of#

IEventEmitter.off

Defined in#

util/EventEmitter.ts:27


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

Implementation of#

IEventEmitter.on

Defined in#

util/EventEmitter.ts:50