module@warp-drive/core/signals/-leaked
Function getPaginationLinks() sincev5.9.0
ts
function getPaginationLinks<RT, E>(state): Readonly<PaginationLinks<RT, E>>;Defined in: warp-drive-packages/core/src/signals/pagination-links.ts:372
Get the PaginationLinks for a given PaginationState. Returns the same instance for the same state, so repeated calls (for example a <Paginate /> component and a separate links component reading the same state) share one set of links. Keyed by state identity, the same way getPaginationState is keyed by request and getRequestState by future.
ts
const links = getPaginationLinks(paginationState);
for (const link of links.links) {
if (link.isReal) {
// render a numbered link, using link.setActive as the click handler
} else {
// render an ellipsis for the gap link.indexRange covers
}
}Type Parameters
RT
RT
E
E
Parameters
state
PagedPaginationState<RT, E>
Returns
Readonly<PaginationLinks<RT, E>>