Skip to content

TypeScript API / contentia/core / ContentiaStream / paginate

Function: paginate() ​

ts
function paginate<A, D, R>(initialCursor, fetchPage): ContentiaStream<A, D, R>;

Paginate through pages, flattening items into the ContentiaStream's data channel. The final done value is taken from the last page fetched ("last wins").

Type Parameters ​

Type ParameterDefault type
A-
D extends ContentiaDone-
Rnever

Parameters ​

ParameterType
initialCursorstring | undefined
fetchPage(cursor) => Effect<{ done: D; items: readonly A[]; nextCursor?: string; }, ContentiaError<ErrorCode, number>, R>

Returns ​

ContentiaStream<A, D, R>