Skip to content

ValueCodec

type ValueCodec<T> = object;

Defined in: tanstack/core/built-in-parsers.ts:488

A value codec: structured data ⇄ opaque token. Structurally matches xtandard’s CursorCodec<T> (from createCursorCodec), so a single codec — with its own serializer/parser/encoder/decoder overrides — can back URL state, pagination, and drizzle-cursor at once.

Must be synchronous: URL parsing runs during render/SSR. Use the sync createCursorCodec variant (the async one is for non-render code paths).

Type Parameter
T
decode: (token) => T;

Defined in: tanstack/core/built-in-parsers.ts:490

Parameter Type
token string

T


encode: (data) => string;

Defined in: tanstack/core/built-in-parsers.ts:489

Parameter Type
data T

string