Type alias Stream<T>

Stream<T>: {
    ended?: boolean;
    end(value?: boolean): void;
    map<R>(fn: MapFunction<T, R>): Stream<R>;
    (value?: T): T;
}

Type Parameters

  • T

    the type of the stream's values.

Type declaration

    • (value?: T): T
    • Function to either send a value onto the stream -- by providing a value, stream1(value) -- or to get the stream's latest value -- by calling the function with no arguments, stream1().

      Returns

      the stream's latest value.

      Parameters

      • Optional value: T

        the value to send onto the stream. If not provided, the function instead returns the stream's latest value.

      Returns T

  • Optional ended?: boolean

    Indicates whether or not this stream has been ended.

  • end:function
    • Ends a stream, so that the streams that were created with map and/or scan no longer receive values from this stream.

      Parameters

      • Optional value: boolean

        the value indicating to end the stream.

      Returns void

  • map:function
    • Function to create a new stream with values that are the result of calling a mapping function on the source stream's values.

      Returns

      a stream resulting from mapping the source stream.

      Type Parameters

      • R

        the type of the returned stream's values.

      Parameters

      Returns Stream<R>

Generated using TypeDoc