Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Stream<T>

Data stream.

Type parameters

  • T

    The type of the streamed data.

Hierarchy

  • Stream

Index

Constructors

Methods

Constructors

constructor

  • Create a new instance of a stream.

    Parameters

    • options: StreamOptions

      The options to use to construct this stream.

    • infiniteReset: (value: T) => T

      A function to use when offsetting the data during moving it to back of the data stream

        • (value: T): T
        • Parameters

          • value: T

          Returns T

    Returns Stream

Methods

forEach

  • forEach(handler: (value: T, index: number, array: T[]) => void): void
  • Calls the handler for each element of the stream.

    Parameters

    • handler: (value: T, index: number, array: T[]) => void

      A function that works just like a normal JavaScript Array.prototype.forEach handler.

        • (value: T, index: number, array: T[]): void
        • Parameters

          • value: T
          • index: number
          • array: T[]

          Returns void

    Returns void

map

  • map(handler: (value: T, index: number, array: T[]) => T): Stream<T>
  • Maps the stream of data.

    Parameters

    • handler: (value: T, index: number, array: T[]) => T

      A function that works just like a normal JavaScript Array.prototype.map handler.

        • (value: T, index: number, array: T[]): T
        • Parameters

          • value: T
          • index: number
          • array: T[]

          Returns T

    Returns Stream<T>

    A new stream with the data mapped by the handler.

push

  • push(newData: T | T[]): void
  • Push new data to the end of stream.

    Parameters

    • newData: T | T[]

      New data point

    Returns void