Skip to content
module@warp-drive/core/signals/-leaked

Function getPaginationState() sincev5.9.0

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

Defined in: warp-drive-packages/core/src/signals/pagination-state.ts:641

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.