• Drops duplicate values in a stream.

    Marble diagram:

    -1-1-1-2-4-3-3-4--
      dropDuplicates
    -1-----2-4-3------
    

    Each value must be uniquely identified by a string given by valueToKey(value).

    Internally this maintains a set of keys that have been processed already, i.e. memory consumption and Set lookup times should be considered when using this function.

    Type Parameters

    • T

    Parameters

    • valueToKey: ((x: T) => string)
        • (x: T): string
        • Parameters

          • x: T

          Returns string

    Returns SameTypeStreamOperator<T>

Generated using TypeDoc