Skip to content

zipLongestAsync

zipLongestAsync<T, F>(iterables, fill): AsyncIterableIterator<ZippedLongest<T, F>>

Defined in: packages/core/src/iterable/async/zip-longest.ts:19

Yields tuples pairing the first element of every iterable, then the second, and so on, continuing until the longest one runs out and substituting fill for every iterable that has already ended.

The async counterpart of zipLongest. Each round advances every unexhausted source concurrently.

Time complexity: O(1) per tuple, allocating one tuple per yield.

T extends readonly MaybeAsyncIterable<unknown>[]

F

T

The iterables to advance in lockstep.

F

The value standing in for an iterable that has already ended.

AsyncIterableIterator<ZippedLongest<T, F>>

An iterator over the tuples. Empty when no iterables were given.