@metreeca/flow - v0.9.21
    Preparing search index...

    Function toArray

    • Creates a sink collecting the items of the feed into an array.

      Items are collected in source order and the array is made immutable once the feed is drained, freezing it together with the items collected into it.

      Warning

      Accumulates the whole feed in memory. For large or infinite feeds, this may exhaust memory or never complete.

      Warning

      Freezing clones structured items, giving them a fresh identity: entries are not reachable through the original item reference. Supply structured items as immutable values to keep their identity stable.

      Type Parameters

      • V

        The type of items in the feed

      Returns Sink<V, readonly V[]>

      A sink resolving to the deeply immutable read-only array of the items of the feed

      await pipe(
      (items(1, 2, 3))
      (toArray())
      ); // [1, 2, 3]