Skip to content
module@warp-drive/experiments/pagination @experimental

Function getPaginationState() sincev5.9.0

ts
function getPaginationState<RT, E>(request: Future<RT>, pageHints?: PageHints): PaginationState<RT, E>;

Defined in: node_modules/.pnpm/@warp-d_5e1563e0e582c8365bb74466d3761d6d/node_modules/@warp-drive/core/dist/signals/-leaked.d.ts:518

Get the PaginationState for a given request. Returns the same instance for the same request future, so that repeated calls (e.g. in a template, or alongside the <Paginate /> component using the same request) share the same local pagination state. Keyed by request identity, just like getRequestState.

ts
const future = store.request(query);
const pages = getPaginationState(future);

await future;
pages.totalPages; // now known, if the response exposed it
await pages.loadNext();

Type Parameters

RT

RT

E

E

Parameters

request

Future<RT>

pageHints?

PageHints

Returns

PaginationState<RT, E>

Released under the MIT License.