The page data type.
Fetches a page by zero-based index.
Fetching starts on the first iteration. Exiting the generator early does not cancel in-flight fetches or prevent subsequently discovered pages from being fetched. Pages are buffered without backpressure for slower consumers.
for await (const { page, index } of fetchPages(fetcher)) {
console.log(`Page ${index}:`, page);
}
forEachPage for a callback-based alternative.
Fetches pages as an async generator, yielding each non-nullish page with its index.
Wrapper around forEachPage. Pages may yield out-of-order due to parallel fetching.