Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / index / setCurrentPageResolver

Function: setCurrentPageResolver()

setCurrentPageResolver(resolver): void

Defined in: pipeline/currentPage.ts:25

Override where paginate() reads the current page for the rest of this request.

The default reads the query string, which is what a plain HTTP request wants. A server-driven view whose page number lives in component state rather than the URL registers its own instead — Flow's Pagination mixin does exactly this, so Post.paginate(10) inside a component follows the component's page.

Scoped to the request: the resolver goes on the active HttpContext, reached through request-scoped storage, so it lasts exactly as long as the request does and never reaches another one. Keep it that way — a module-level slot would not be request-scoped.

Parameters

resolver

CurrentPageResolver

Called with the paginator name; return undefined to defer to the query string.

Returns

void