AsyncEventDispatcher
class AsyncEventDispatcherT extends EventDispatcherBaseTAsyncEventHandlerT
Dispatches an asynchronous SubscribableEvent
.
The dispatch
method returns a promise that resolves when all the
handlers resolve.
Examples
Type Parameters
T
The type of the argument passed to subscribers.
Constructors
constructor
public new AsyncEventDispatcherT(): AsyncEventDispatcherT
Type Parameters
Inherited fromEventDispatcherBase.constructor
Properties
subscribable
readonly public subscribable: SubscribableTAsyncEventHandlerT = ...
EventDispatcherBase.subscribable
Methods
clear
public clear(): void
Unsubscribe all subscribers from the event.
Inherited fromEventDispatcherBase.clear
dispatch
Parameters
subscribe
public subscribehandler: AsyncEventHandlerT: () => void
Subscribe to the event.
Parameters
handler: AsyncEventHandlerT
The handler to invoke when the event occurs.
EventDispatcherBase.subscribe
unsubscribe
public unsubscribehandler: AsyncEventHandlerT: void
Unsubscribe from the event.
Parameters
handler: AsyncEventHandlerT
The handler to unsubscribe.
EventDispatcherBase.unsubscribe