API

QueryStateClient

The per-router cache and batched writer behind every composable.

useQueryStateClient

Returns the client of the current router, creating it on first use.

const 
client
=
useQueryStateClient
()
MethodDescription
get(key)The raw value, or null when the key is absent.
set(key, value, historyMode?)Writes a raw value; null removes the key. Batched with every other write of the tick.
setBatch(updates, historyMode?)Writes several keys at once.
subscribe(listener)Calls listener(key, value) on every change. Returns an unsubscribe function.
issuesA reactive ReadonlyMap<urlKey, { raw, reason, message, rule? }> of URL values that were rejected or only partly used. See Validation.

registerQueryStateClient

Registers a client you created yourself, for example to change the default history mode. Call it before the first composable runs.

registerQueryStateClient
(
router
, new
QueryStateClient
({
router
,
defaultHistoryMode
: 'push' }))
QueryStateClient optionTypeDefault
routerRouterrequired
defaultHistoryMode'push' | 'replace''replace'
Copyright © 2026 Cyprien Thao. Released under the MIT License.