Skip to content

TypeScript API / laikacms/core / LaikaStream / paginate

Function: paginate() ​

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

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

Type Parameters ​

Type ParameterDefault type
A-
D extends LaikaDone-
Rnever

Parameters ​

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

Returns ​

LaikaStream<A, D, R>

Released under the MIT License.