The most generic event receiver form.

Any event receiver may be converted to generic form by eventReceiver function.

In contrast to Object this one always has a supply.

Type Parameters

  • TEvent extends any[]

    An event type. This is a tuple of event receiver parameter types.

Hierarchy

Properties

Methods

Properties

supply: Supply

Event supply to this receiver.

Events will be supplied to this receiver until this supply is Supply.off cut off.

Methods

  • Receives an event.

    This method does not require a this context. So it is possible to deconstruct the event receiver like this:

    const { supply, receive } = eventReceiver(receiver);
    

    Parameters

    • this: void
    • context: EventReceiver.Context<TEvent>

      An event processing context.

    • Rest ...event: TEvent

      An event represented as the rest of arguments.

    Returns void

Generated using TypeDoc