Reflex Cloud - Fast, secure & scalable hosting. One command to deploy.

Statemanager

reflex.state.StateManager

A class to manage many client states.

Fields

PropDescription
state: Type

The state class to use.

Methods

SignatureDescription
create(cls, state: 'Type[BaseState]')Create a new state manager.
get_state(self, token: 'str') -> 'BaseState'Get the state for a token.
set_state(self, token: 'str', state: 'BaseState')Set the state for a token.
modify_state(self, token: 'str') -> 'AsyncIterator[BaseState]'Modify the state for a token while holding exclusive lock.