• Creates an event processor that translates events incoming from AfterEvent keeper.

    The translated events expected to be sent by the given translate function.

    The returned mapper does the same as the one created by translateOn one, but returns an AfterEvent keeper instead of OnEvent sender. This can not be always done without a fallback, as not every transformation results to valid EventKeeper. E.g. when some events filtered out.

    Type Parameters

    • TInEvent extends any[]

      Incoming event type.

    • TOutEvent extends any[]

      Outgoing translated event type.

    Parameters

    • translate: ((this, send, ...event) => void)

      Event translation function. Accepts an outgoing event sender function as first parameter, and incoming event as the rest of them.

        • (this, send, ...event): void
        • Parameters

          • this: void
          • send: ((...event) => void)
              • (...event): void
              • Parameters

                • Rest ...event: TOutEvent

                Returns void

          • Rest ...event: TInEvent

          Returns void

    Returns ((this, input) => AfterEvent<TOutEvent>)

    A mapping function of incoming event keeper to another one.

  • Creates an event processor that translates events incoming from OnEvent sender with fallback.

    The translated events expected to be sent by the given translate function.

    The returned mapper does the same as the one created by translateOn one, but returns an AfterEvent keeper instead of OnEvent sender. This can not be always done without a fallback, as not every transformation results to valid EventKeeper. E.g. when some events filtered out.

    Type Parameters

    • TInEvent extends any[]

      Incoming event type.

    • TOutEvent extends any[]

      Outgoing translated event type.

    Parameters

    • translate: ((this, send, ...event) => void)

      Event translation function. Accepts an outgoing event sender function as first parameter, and incoming event as the rest of them.

        • (this, send, ...event): void
        • Parameters

          • this: void
          • send: ((...event) => void)
              • (...event): void
              • Parameters

                • Rest ...event: TOutEvent

                Returns void

          • Rest ...event: TInEvent

          Returns void

    • fallback: ((this) => TOutEvent)

      A function creating outgoing event fallback.

        • (this): TOutEvent
        • Parameters

          • this: void

          Returns TOutEvent

    Returns ((this, input) => AfterEvent<TOutEvent>)

    A mapping function of incoming event keeper to another one.

Generated using TypeDoc