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

    Function toSet

    • Creates a sink collecting all unique items into a set.

      Type Parameters

      • V

        The type of items in the stream

      Returns Sink<V, ReadonlySet<V>>

      A sink that collects all unique items into a set

      await items([1, 2, 2, 3, 3, 3])(toSet());  // Set(3) { 1, 2, 3 }
      await items([1, 2, 3])(toSet()); // Set(3) { 1, 2, 3 }