Skip to content

Function: paginateByPage()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / paginateByPage

paginateByPage<TItem>(read, options?, requestOptions?): AsyncGenerator<TItem, void, undefined>

Defined in: src/pagination.ts:192

Iterate a page/pageSize endpoint, one item at a time.

TItem

NumberedPageReader<TItem>

Reads one page. Pages are 1-based.

PaginateOptions

Page size and an optional overall cap.

RequestOptions

Per-call options, applied to EVERY page request.

AsyncGenerator<TItem, void, undefined>

An async iterator over the items.

for await (const entry of client.audit.iterate({ eventType: 'credit_decision' })) {
console.log(entry.action);
}