[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/core](../../README) / [index](../README) / setCurrentPageResolver

# Function: setCurrentPageResolver()

> **setCurrentPageResolver**(`resolver`): `void`

Defined in: [pipeline/currentPage.ts:25](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/pipeline/currentPage.ts#L25)

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](../classes/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`](../type-aliases/CurrentPageResolver)

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

## Returns

`void`
