Statemanager
reflex.istate.manager.StateManagerA class to manage many client states.
Methods
| Signature | Description |
|---|---|
create() | Create a new state manager. |
get_state(token: StateToken[TOKEN_TYPE] | str) -> TOKEN_TYPE | Get 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. |