EventEmitterable
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()
Alias for on.
Parameters
Parameter | Type |
---|---|
event | T |
listener | Listener |
zone ? | Zone |
Returns
Promise
<EventEmitterable
<T
>>
Source
emit()
Triggers each listener for event
with the args
.
Parameters
Parameter | Type |
---|---|
event | T |
zone ? | Zone |
…args ? | any [] |
Returns
Promise
<boolean
>
Source
listenerCount()
Resolves to the number of listeners for event
.
Parameters
Parameter | Type |
---|---|
event ? | T |
Returns
Promise
<number
>
Source
listeners()
Resolves to the listeners for event
.
Parameters
Parameter | Type |
---|---|
event ? | T |
Returns
Promise
<Listener
[]>
Source
off()
Unregister the listener
for event
. If listener
is unspecified, all listeners are unregistered.
Parameters
Parameter | Type |
---|---|
event | T |
listener ? | Listener |
zone ? | Zone |
Returns
Promise
<EventEmitterable
<T
>>
Source
on()
Registers a listener
that is called whenever the event
occurs until unregistered.
Parameters
Parameter | Type |
---|---|
event | T |
listener | Listener |
zone ? | Zone |
Returns
Promise
<EventEmitterable
<T
>>
Source
once()
Registers a listener
that is called the next time event
occurs.
Parameters
Parameter | Type |
---|---|
event | T |
listener | Listener |
zone ? | Zone |
Returns
Promise
<EventEmitterable
<T
>>
Source
removeAllListeners()
Unregister all listeners for event
.
Parameters
Parameter | Type |
---|---|
event ? | T |
Returns
Promise
<EventEmitterable
<T
>>
Source
removeListener()
Alias for off.
Parameters
Parameter | Type |
---|---|
event | T |
listener | Listener |
zone ? | Zone |
Returns
Promise
<EventEmitterable
<T
>>
Source
Was this page helpful?