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]] Copy
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:
Tuple type with item type of each input iterator
The iterators to be zipped
Take any number of iterators, and zip them together into one iterator of tuples. Closes after the shortest of the inputs closes.
See also: