cytoplasmic
    Preparing search index...

    Class Emitter<TEvent>Abstract

    An event emitter

    Type Parameters

    • TEvent

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Methods

    • Filter events emitted by this emitter.

      Parameters

      • f: (event: TEvent) => boolean

        The predicate to apply to each event.

      Returns Emitter<TEvent>

      An emitter than only emits events emitted by this emitter for which f returns true.

    • Creates an emitter that counts events emitted by this emitter.

      Returns Emitter<number>

      An emitter that emits the index, starting at zero, of every event emitted by this emitter.

    • Apply a function to all events and their index (starting at zero) emitted by this emitter.

      Type Parameters

      • TOut

      Parameters

      Returns Emitter<TOut>

      An emitter that applies the function f to all events emitted by this emitter.

    • Apply a function to all events emitted by this emitter.

      Type Parameters

      • TOut

      Parameters

      • f: (event: TEvent) => TOut

        The function to apply to events.

      Returns Emitter<TOut>

      An emitter that applies the function f to all events emitted by this emitter.

    • Create a promise that resolves the next time an event is emitted by this emitter.

      Returns Promise<TEvent>

      A promise that resolves to the next event emitted by this emitter.