An EventEmitterable behaves similar to an EventEmitter except provides async access to its methods.

An EventEmitter implements the observer pattern.

Extended by

Type parameters

Type parameter
T

Methods

addListener()

addListener(
   event, 
   listener, 
zone?): Promise<EventEmitterable<T>>

Alias for on.

Parameters

ParameterType
eventT
listenerListener
zone?Zone

Returns

Promise<EventEmitterable<T>>

Source

utils/events.ts:61


emit()

emit(
   event, 
   zone?, ...
args?): Promise<boolean>

Triggers each listener for event with the args.

Parameters

ParameterType
eventT
zone?Zone
args?any[]

Returns

Promise<boolean>

Source

utils/events.ts:36


listenerCount()

listenerCount(event?): Promise<number>

Resolves to the number of listeners for event.

Parameters

ParameterType
event?T

Returns

Promise<number>

Source

utils/events.ts:41


listeners()

listeners(event?): Promise<Listener[]>

Resolves to the listeners for event.

Parameters

ParameterType
event?T

Returns

Promise<Listener[]>

Source

utils/events.ts:46


off()

off(
   event, 
   listener?, 
zone?): Promise<EventEmitterable<T>>

Unregister the listener for event. If listener is unspecified, all listeners are unregistered.

Parameters

ParameterType
eventT
listener?Listener
zone?Zone

Returns

Promise<EventEmitterable<T>>

Source

utils/events.ts:51


on()

on(
   event, 
   listener, 
zone?): Promise<EventEmitterable<T>>

Registers a listener that is called whenever the event occurs until unregistered.

Parameters

ParameterType
eventT
listenerListener
zone?Zone

Returns

Promise<EventEmitterable<T>>

Source

utils/events.ts:26


once()

once(
   event, 
   listener, 
zone?): Promise<EventEmitterable<T>>

Registers a listener that is called the next time event occurs.

Parameters

ParameterType
eventT
listenerListener
zone?Zone

Returns

Promise<EventEmitterable<T>>

Source

utils/events.ts:31


removeAllListeners()

removeAllListeners(event?): Promise<EventEmitterable<T>>

Unregister all listeners for event.

Parameters

ParameterType
event?T

Returns

Promise<EventEmitterable<T>>

Source

utils/events.ts:56


removeListener()

removeListener(
   event, 
   listener, 
zone?): Promise<EventEmitterable<T>>

Alias for off.

Parameters

ParameterType
eventT
listenerListener
zone?Zone

Returns

Promise<EventEmitterable<T>>

Source

utils/events.ts:66