@metreeca/pipe - v0.9.11
    Preparing search index...

    Function distinct

    • Creates a task filtering out duplicate items.

      Items are processed sequentially and output order is preserved. Only the first occurrence of each unique item is yielded.

      Type Parameters

      • V

        The type of items in the stream

      • K

        The type of comparison key

      Parameters

      • Optionalselector: (item: V) => K | Promise<K>

        Optional function to extract comparison key from items

      Returns Task<V>

      A task that filters out duplicate items

      Maintains a Set of all seen items in memory. For large or infinite streams with many unique items, this may cause memory issues.