Skip to main content

@dialstack/sdk-dev / webrtc/src / createPaginatedList

Function: createPaginatedList()

TypeScript
function createPaginatedList<P>(firstPagePromise, fetchNextPage): PaginatedList<P>;

Defined in: sdk/webrtc/src/pagination.ts:37

Wrap a first-page promise with auto-pagination. fetchNextPage receives the next_page_url from the previous page (a path relative to the API base).

Type Parameters​

P​

P extends Page<unknown>

Parameters​

firstPagePromise​

Promise<P>

fetchNextPage​

(url) => Promise<P>

Returns​

PaginatedList<P>