Function createDropRepeats

  • Credit: James Forbes (https://james-forbes.com/)

    Creates a dropRepeats function, which returns new stream that drops repeated values from the source stream.

    Parameters

    • stream: ExternalStreamLib = simpleStream

      the stream library, defaults to simpleStream.

    Returns (<S>(source: Stream<S>, onchange?: ((state: S) => any)) => Stream<S>)

      • <S>(source: Stream<S>, onchange?: ((state: S) => any)): Stream<S>
      • Returns

        a stream that does not emit repeated values.

        Type Parameters

        • S

        Parameters

        • source: Stream<S>

          the source stream.

        • onchange: ((state: S) => any) = ...

          function that receives the current state of the source stream and returns the value for which changes will emit onto the returned stream.

            • (state: S): any
            • Parameters

              • state: S

              Returns any

        Returns Stream<S>

Generated using TypeDoc