Skip to main content
Version: Next

Class: EventEmitter

molecule.event.EventEmitter

Constructors

constructor

new EventEmitter()

Properties

_events

Private _events: Map<string, Function[]>

Defined in

common/event/eventEmitter.ts:6

Methods

assignEvent

assignEvent<T>(name, listener): void

Type parameters

Name
T

Parameters

NameType
namestring
listenerFunction

Returns

void

Defined in

common/event/eventEmitter.ts:63


count

count(name): number

Parameters

NameType
namestring

Returns

number

Defined in

common/event/eventEmitter.ts:8


deleteEvent

deleteEvent(name, listener?): void

Parameters

NameType
namestring
listener?Function

Returns

void

Defined in

common/event/eventEmitter.ts:52


emit

emit(name, ...args): void

Parameters

NameType
namestring
...argsany[]

Returns

void

Defined in

common/event/eventEmitter.ts:13


subscribe

subscribe(name, listener): void

Parameters

NameType
namestring | string[]
listenerFunction

Returns

void

Defined in

common/event/eventEmitter.ts:32


unsubscribe

unsubscribe(name, listener?): void

Parameters

NameType
namestring | string[]
listener?Function

Returns

void

Defined in

common/event/eventEmitter.ts:42