Function distinctUntilChanged

  • Returns a Stream that yields elements from the source that are distinct from the previous element.

    Type Parameters

    • T

      Type of items in the source.

    Parameters

    Returns OperationFunction<T, T>

    Operation that yields elements from the source that are distinct from the previous element.

    const result = distinctUntilChanged<number>()([1, 1, 2, 2, 3, 3]);
    console.log([...result]); // [1, 2, 3]