Interface EventDispatcher<Events>

Type-safe event dispatcher.

interface EventDispatcher {
    addEventListener<K>(type, listener): void;
    dispatchEvent(event): boolean;
    removeEventListener<K>(type, listener): void;
}

Type Parameters

Hierarchy

Implemented by

Methods

  • Dispatches the event to the list of handlers for event.type.

    Parameters

    • event: Events[keyof Events]

    Returns boolean

    false if event is cancelled; true otherwise.

Generated using TypeDoc