yta
    Preparing search index...

    Function zip

    • Take any number of iterators, and zip them together into one iterator of tuples. Closes after the shortest of the inputs closes.

      import { pipe } from "yta";
      import { flatRepeat, of, toArray, zip } from "yta/async";
      import { range } from "yta/sync";

      await pipe(
      zip(
      of("a", "b", "c"),
      range(),
      flatRepeat(() => of(true, false)),
      ),
      toArray(),
      );
      // => [["a", 0, true], ["b", 1, false], ["c", 2, true]]

      See also:

      Type Parameters

      • A extends unknown[]

        Tuple type with item type of each input iterator

      Parameters

      • ...items: { [K in string | number | symbol]: AsyncIterable<A[K<K>], any, any> }

        The iterators to be zipped

      Returns AsyncGenerator<A, void, any>