For AI agents: the complete documentation index is at llms.txt. Markdown versions are available by appending .md or sending Accept: text/markdown.
Reflex Logo
Docs Logo
Api Reference

/

Statemanager

Statemanager

reflex.istate.manager.StateManager

A class to manage many client states.

Methods

SignatureDescription
create()Create a new state manager.
get_state(token: StateToken[TOKEN_TYPE] | str) -> TOKEN_TYPEGet the state for a token.
set_state(token: StateToken[TOKEN_TYPE] | str, state: TOKEN_TYPE, **context: Unpack[StateModificationContext])Set the state for a token.
modify_state(token: StateToken[TOKEN_TYPE] | str, **context: Unpack[StateModificationContext]) -> AsyncIterator[TOKEN_TYPE]Modify the state for a token while holding exclusive lock.
modify_state_with_links(token: StateToken[TOKEN_TYPE] | str, previous_dirty_vars: Optional[dict[str, set[str]]] = None, **context: Unpack[StateModificationContext]) -> AsyncIterator[TOKEN_TYPE]Modify the state for a token, including linked substates, while holding exclusive lock.
close()Close the state manager.
Built with Reflex