API ReferenceSetup and configurationFunction
iterateCollectionPages()
function iterateCollectionPages<T, Params>( fetchPage, params, options?): AsyncGenerator<CollectionPage<T>, void, void>;Lazily yields collection pages in order until the exact next cursor is null.
A later failure rejects that iteration step without changing pages already yielded to the caller. Repeated cursors fail closed before another request can loop.
Type Parameters
| Type Parameter |
|---|
T |
Params extends CollectionRequest |
Parameters
| Parameter | Type | Description |
|---|---|---|
fetchPage | CollectionPageFetcher<T, Params> | Page reader that accepts execution controls separately. |
params | Params | Collection filters and initial cursor. |
options | ReadExecutionOptions | Cancellation controls shared by every page. |
Returns
AsyncGenerator<CollectionPage<T>, void, void>