Skip to content

Page

Page: object

Defined in: packages/core/src/types.ts:145

Companion object for the Page type. Provides transformation and factory utilities.

readonly empty: <T>() => Page<T>

Create an empty page with no items.

T

Page<T>

an empty Page with hasMore=false

Safe — pure function

readonly map: <T, U>(page, fn) => Page<U>

Transform items in a page while preserving pagination metadata.

T

U

Page<T>

the source page

(item) => U

mapping function applied to each item

Page<U>

a new Page with transformed items

cursor, total, and hasMore are preserved

Safe — pure function

const mapped = Page.map(page, (item) => item.id);
const empty = Page.empty<Archive>();