Interface EventBus<E>

interface EventBus<E> {
    emit<EventName>(name, event): void;
    getVersion(): string;
    subscribe<EventName>(name, handler): void;
    unsubscribe<EventName>(name, handler): void;
}

Type Parameters

Implemented by

Methods

  • Emit an event on the event bus

    Type Parameters

    • EventName extends string | number | symbol

    Parameters

    Returns void

  • Get the version of this event bus instance This is used for compatibility checking

    Returns string

  • Subscribe the event bus

    Type Parameters

    • EventName extends string | number | symbol

    Parameters

    Returns void

  • Unsubscribe a handler on one event from the event bus

    Type Parameters

    • EventName extends string | number | symbol

    Parameters

    Returns void