zipAsync
zipAsync<
T>(iterables):AsyncIterableIterator<Zipped<T>>
Defined in: packages/core/src/iterable/async/zip.ts:22
Yields tuples pairing the first element of every iterable, then the second, and so on, stopping as soon as any one of them runs out.
The async counterpart of zip. Sources may be mixed, so a materialised array
can be paired with a stream. Each round advances every source concurrently
rather than one after another, so a round costs the slowest source, not their
sum.
Every source iterator is closed when iteration ends, whether it ended by exhaustion or because the consumer stopped pulling.
Time complexity: O(1) per tuple, allocating one tuple per yield.
Type Parameters
Section titled “Type Parameters”T extends readonly MaybeAsyncIterable<unknown>[]
Parameters
Section titled “Parameters”iterables
Section titled “iterables”T
The iterables to advance in lockstep.
Returns
Section titled “Returns”AsyncIterableIterator<Zipped<T>>
An iterator over the tuples. Empty when no iterables were given.