Function: paginate()
ts
function paginate<T>(fetchPage): AsyncGenerator<T>;Walks every page of a cursor-paginated endpoint, yielding items one by one. fetchPage takes the cursor (undefined for the first page) and returns a Page. Iteration stops when a page has no nextCursor.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fetchPage | (cursor?) => Promise<Page<T>> |
Returns
AsyncGenerator<T>