A sender of events.

Contains an OnEvent instance registering event receivers.

Type Parameters

  • TEvent extends any[]

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

Hierarchy

  • Starts sending events to the given receiver.

    Parameters

    Returns Supply

    A supply of events from this sender to the given receiver.

Methods

  • Applies the given processor to events.

    Type Parameters

    • TResult

      Action result type.

    Parameters

    • processor: ((this, supplier) => TResult)

      An event processor accepting this supplier as its only parameter, and returning application result.

        • (this, supplier): TResult
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult

    Returns TResult

    Processing result.

  • Applies the given processors to events.

    The value returned from each processor application is passed as argument to the next one. The value returned from the last processor application is the result of this method call.

    Type Parameters

    • TResult1

      The second processor application result type.

    • TResult2

    Parameters

    • processor1: ((this, supplier) => TResult1)

      An event processor accepting this supplier as its only parameter, and returning application result.

        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)

      An event processor accepting the first one's application result as its only parameter, and returning its own application result.

        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    Returns TResult2

    The last processor application result.

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    Returns TResult3

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    Returns TResult4

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    Returns TResult5

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    Returns TResult6

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    • TResult7

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    • processor7: ((this, arg) => TResult7)
        • (this, arg): TResult7
        • Parameters

          • this: void
          • arg: TResult6

          Returns TResult7

    Returns TResult7

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    • TResult7

    • TResult8

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    • processor7: ((this, arg) => TResult7)
        • (this, arg): TResult7
        • Parameters

          • this: void
          • arg: TResult6

          Returns TResult7

    • processor8: ((this, arg) => TResult8)
        • (this, arg): TResult8
        • Parameters

          • this: void
          • arg: TResult7

          Returns TResult8

    Returns TResult8

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    • TResult7

    • TResult8

    • TResult9

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    • processor7: ((this, arg) => TResult7)
        • (this, arg): TResult7
        • Parameters

          • this: void
          • arg: TResult6

          Returns TResult7

    • processor8: ((this, arg) => TResult8)
        • (this, arg): TResult8
        • Parameters

          • this: void
          • arg: TResult7

          Returns TResult8

    • processor9: ((this, arg) => TResult9)
        • (this, arg): TResult9
        • Parameters

          • this: void
          • arg: TResult8

          Returns TResult9

    Returns TResult9

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    • TResult7

    • TResult8

    • TResult9

    • TResult10

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    • processor7: ((this, arg) => TResult7)
        • (this, arg): TResult7
        • Parameters

          • this: void
          • arg: TResult6

          Returns TResult7

    • processor8: ((this, arg) => TResult8)
        • (this, arg): TResult8
        • Parameters

          • this: void
          • arg: TResult7

          Returns TResult8

    • processor9: ((this, arg) => TResult9)
        • (this, arg): TResult9
        • Parameters

          • this: void
          • arg: TResult8

          Returns TResult9

    • processor10: ((this, arg) => TResult10)
        • (this, arg): TResult10
        • Parameters

          • this: void
          • arg: TResult9

          Returns TResult10

    Returns TResult10

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    • TResult7

    • TResult8

    • TResult9

    • TResult10

    • TResult11

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    • processor7: ((this, arg) => TResult7)
        • (this, arg): TResult7
        • Parameters

          • this: void
          • arg: TResult6

          Returns TResult7

    • processor8: ((this, arg) => TResult8)
        • (this, arg): TResult8
        • Parameters

          • this: void
          • arg: TResult7

          Returns TResult8

    • processor9: ((this, arg) => TResult9)
        • (this, arg): TResult9
        • Parameters

          • this: void
          • arg: TResult8

          Returns TResult9

    • processor10: ((this, arg) => TResult10)
        • (this, arg): TResult10
        • Parameters

          • this: void
          • arg: TResult9

          Returns TResult10

    • processor11: ((this, arg) => TResult11)
        • (this, arg): TResult11
        • Parameters

          • this: void
          • arg: TResult10

          Returns TResult11

    Returns TResult11

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    • TResult7

    • TResult8

    • TResult9

    • TResult10

    • TResult11

    • TResult12

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    • processor7: ((this, arg) => TResult7)
        • (this, arg): TResult7
        • Parameters

          • this: void
          • arg: TResult6

          Returns TResult7

    • processor8: ((this, arg) => TResult8)
        • (this, arg): TResult8
        • Parameters

          • this: void
          • arg: TResult7

          Returns TResult8

    • processor9: ((this, arg) => TResult9)
        • (this, arg): TResult9
        • Parameters

          • this: void
          • arg: TResult8

          Returns TResult9

    • processor10: ((this, arg) => TResult10)
        • (this, arg): TResult10
        • Parameters

          • this: void
          • arg: TResult9

          Returns TResult10

    • processor11: ((this, arg) => TResult11)
        • (this, arg): TResult11
        • Parameters

          • this: void
          • arg: TResult10

          Returns TResult11

    • processor12: ((this, arg) => TResult12)
        • (this, arg): TResult12
        • Parameters

          • this: void
          • arg: TResult11

          Returns TResult12

    Returns TResult12

  • Type Parameters

    • TResult1

    • TResult2

    • TResult3

    • TResult4

    • TResult5

    • TResult6

    • TResult7

    • TResult8

    • TResult9

    • TResult10

    • TResult11

    • TResult12

    • TResult13

    Parameters

    • processor1: ((this, supplier) => TResult1)
        • (this, supplier): TResult1
        • Parameters

          • this: void
          • supplier: OnEvent<TEvent>

          Returns TResult1

    • processor2: ((this, arg) => TResult2)
        • (this, arg): TResult2
        • Parameters

          • this: void
          • arg: TResult1

          Returns TResult2

    • processor3: ((this, arg) => TResult3)
        • (this, arg): TResult3
        • Parameters

          • this: void
          • arg: TResult2

          Returns TResult3

    • processor4: ((this, arg) => TResult4)
        • (this, arg): TResult4
        • Parameters

          • this: void
          • arg: TResult3

          Returns TResult4

    • processor5: ((this, arg) => TResult5)
        • (this, arg): TResult5
        • Parameters

          • this: void
          • arg: TResult4

          Returns TResult5

    • processor6: ((this, arg) => TResult6)
        • (this, arg): TResult6
        • Parameters

          • this: void
          • arg: TResult5

          Returns TResult6

    • processor7: ((this, arg) => TResult7)
        • (this, arg): TResult7
        • Parameters

          • this: void
          • arg: TResult6

          Returns TResult7

    • processor8: ((this, arg) => TResult8)
        • (this, arg): TResult8
        • Parameters

          • this: void
          • arg: TResult7

          Returns TResult8

    • processor9: ((this, arg) => TResult9)
        • (this, arg): TResult9
        • Parameters

          • this: void
          • arg: TResult8

          Returns TResult9

    • processor10: ((this, arg) => TResult10)
        • (this, arg): TResult10
        • Parameters

          • this: void
          • arg: TResult9

          Returns TResult10

    • processor11: ((this, arg) => TResult11)
        • (this, arg): TResult11
        • Parameters

          • this: void
          • arg: TResult10

          Returns TResult11

    • processor12: ((this, arg) => TResult12)
        • (this, arg): TResult12
        • Parameters

          • this: void
          • arg: TResult11

          Returns TResult12

    • processor13: ((this, arg) => TResult13)
        • (this, arg): TResult13
        • Parameters

          • this: void
          • arg: TResult12

          Returns TResult13

    Returns TResult13

  • Attaches callbacks to the next event and/or supply cut off reason.

    This method makes event sender act as promise-like for the first parameter of the next event. Thus it is possible e.g. to use it in await expression.

    Type Parameters

    • TResult1 = TEvent extends [F, ...any[]]
          ? F
          : undefined

    • TResult2 = never

    Parameters

    • Optional onEvent: null | ((...event) => TResult1 | PromiseLike<TResult1>)

      The callback to execute when next event received.

    • Optional onCutOff: null | ((reason) => TResult2 | PromiseLike<TResult2>)

      The callback to execute when supply is cut off before the next event received.

    Returns Promise<TResult1 | TResult2>

    A Promise for the next event.

Generated using TypeDoc