Skip to content

paginate

paginate<T>(fetchPage, params?): AsyncGenerator<T, void, undefined>

Defined in: packages/core/src/pagination.ts:22

Drive a cursor-paginated endpoint as an async iterator.

T

(params) => Promise<CursorPage<T>>

Omit<CursorPaginationParams, "cursor"> = {}

AsyncGenerator<T, void, undefined>

for await (const order of paginate((p) => client.orders.list(p))) {
console.log(order.id);
}

Unofficial. Lonca is an independent, community-maintained project — not affiliated with, endorsed by, or supported by Trendyol, Hepsiburada, or any other marketplace. All marketplace names and trademarks belong to their respective owners.