windowedAsync
windowedAsync<
T>(iterable,size,step?):AsyncIterableIterator<T[]>
Defined in: packages/core/src/iterable/async/windowed.ts:17
Yields every overlapping window of size consecutive elements.
The async counterpart of windowed. Not chunkAsync: windows overlap,
chunks do not, and a short trailing window is never yielded.
Time complexity: O(n), allocating one array per window.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
number
How many elements per window. Must be a positive integer.
number = 1
How far to advance between windows. Must be a positive integer.
Returns
Section titled “Returns”AsyncIterableIterator<T[]>
An iterator over the windows.
Throws
Section titled “Throws”If size or step is not a positive integer.