Skip to content

TypedStateToken

type TypedStateToken<T> = intersection

State token that carries the value type T.

Created by flareState and passed to ctx.require(), ctx.get(), and ctx.set(). The token is a plain object: its reference identity is what makes it unique. Tokens cannot be extended; use flareState to create a new one.

Assignable to StateToken wherever the value type is not needed.

The _type field is a phantom type: it exists only at compile time to carry T through the token so state reads and writes stay typed.

Learn: Reading state

Last updated: