springboard • Docs
springboard / module_api / StatesAPI
Class: StatesAPI
The States API is used for creating shared, persistent, and user-scoped states.
Methods
createPersistentState()
createPersistentState<
State
>(stateName
:string
,initialValue
:State
):Promise
<StateSupervisor
<State
>>
Create a piece of state to be saved in persistent storage such as a database or localStorage. If the deployment is multi-player, then this data is shared between all connected devices.
createSharedState()
createSharedState<
State
>(stateName
:string
,initialValue
:State
):Promise
<StateSupervisor
<State
>>
Create a piece of state to be shared between all connected devices. This state should generally be treated as ephemeral, though it will be cached on the server to retain application state.
createUserAgentState()
createUserAgentState<
State
>(stateName
:string
,initialValue
:State
):Promise
<StateSupervisor
<State
>>
Create a piece of state to be saved on the given user agent. In the browser's case, this will use localStorage