Class DomEventDispatcher

DOM event dispatcher can be used to register event listeners of particular event types and dispatch events.

Hierarchy

  • DomEventDispatcher

Implements

  • SupplyPeer

Constructors

Properties

Methods

Constructors

Properties

_target: EventTarget
supply: Supply = ...

Methods

  • Dispatches the given DOM event to event target.

    Calls EventTarget.dispatchEvent() method.

    Parameters

    • event: Event

      An event to dispatch.

    Returns boolean

    true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, or false otherwise. Also returns false when supply is cut off.

  • Returns a sender of DOM events of the given type.

    The returned DOM event sender calls an EventTarget.addEventListener() to register listeners. But, in contrast, it allows to register the same listener many times.

    The Supply event supply returned upon event listener registration unregisters it with EventTarget.removeEventListener() once Supply.off cut off.

    Type Parameters

    • TEvent extends Event<TEvent>

      Supported DOM event type.

    Parameters

    • type: string

      DOM event type name.

    Returns OnDomEvent<TEvent>

    OnDomEvent sender of DOM events of the given type.

Generated using TypeDoc