chunkAsync
chunkAsync<
T>(iterable,size):AsyncIterableIterator<T[]>
Defined in: packages/core/src/iterable/async/chunk.ts:16
Yields consecutive, non-overlapping groups of size items.
The async counterpart of chunk. A final group shorter than size is
yielded as-is when the input length is not a multiple of it.
Time complexity: O(n).
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
number
How many items per group. Must be a positive integer.
Returns
Section titled “Returns”AsyncIterableIterator<T[]>
An iterator over the groups.
Throws
Section titled “Throws”If size is not a positive integer.