mapChunked
mapChunked<
T,R>(items,size,mapper):Promise<R[]>
Defined in: packages/simply-core/src/collection/chunk.ts:59
Map over items in chunks: every item within a chunk is processed concurrently, but one chunk
finishes before the next one starts.
Use this to bound concurrency against an org — firing hundreds of describe() calls at once
gets you rate-limited, while doing them one at a time is needlessly slow. Chunking gives a
fixed-width window without pulling in a queue library.
Type Parameters
Section titled “Type Parameters”T
R
Parameters
Section titled “Parameters”readonly T[]
The items to map over.
number
Maximum number of items processed concurrently. Must be at least 1.
mapper
Section titled “mapper”(item, index) => Promise<R>
Called once per item, with the item and its index in items.
Returns
Section titled “Returns”Promise<R[]>
Every mapper result, in items order (not completion order).
Throws
Section titled “Throws”If size is less than 1.