Skip to content

paginateOffset

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

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

Drive an offset-paginated endpoint as an async iterator. Stops when the server’s pageCount is exhausted (or after the configured maxPages to bound runaway iteration). Default page size is whatever the underlying endpoint clamps to — pass limit explicitly for control.

T

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

number

number

AsyncGenerator<T, void, undefined>

for await (const order of paginateOffset((p) =>
client.orders.list(p),
)) {
console.log(order.orderNumber);
}

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.