Skip to main content

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 from EventDispatcherBase.constructor

Properties

subscribable

Inherited from EventDispatcherBase.subscribable

Methods

clear

public clear(): void

Unsubscribe all subscribers from the event.

Inherited from EventDispatcherBase.clear

dispatch

public dispatchvalue: T: Promisevoid

Parameters


subscribe

public subscribehandler: AsyncEventHandlerT: () => void

Subscribe to the event.

Parameters

Inherited from EventDispatcherBase.subscribe

unsubscribe

public unsubscribehandler: AsyncEventHandlerT: void

Unsubscribe from the event.

Parameters

Inherited from EventDispatcherBase.unsubscribe