StateOptions
Options related to Adaptable State hydration / dehydration; allows users to intercept state persistence and loading with custom functionality
export interfaceProperties
| Property | Description | Default |
|---|---|---|
| applyState | Transforms state before applying it to the application. Called after loadState() but before the state is used. | |
| autoMigrateState | Automatically migrate State from previous AdapTable version to current one | true |
| clearState | Allows clearing of remote Adaptable State. Only invoked during StateApi.reloadInitialState() operations. | undefined |
| debounceStateDelay | Delay (in ms) to debounce saveState / persistState calls enabling grouping multiple sequential calls in single one (e.g. elevator doors) | 400 |
| loadState | Retrieves saved Adaptable State from storage or external source | |
| persistState | Handles the actual storage of state to localStorage, server, etc. Called after saveState() to store the prepared state. | |
| saveState | Transforms state before saving to storage. Called before persistState(). |
Property Details
applyState
Transforms state before applying it to the application. Called after loadState() but before the state is used.
applyState?: AdaptableApplyStateFunction;Property Value
AdaptableApplyStateFunction
autoMigrateState
Automatically migrate State from previous AdapTable version to current one
autoMigrateState?: boolean;Default Value
true
Property Value
boolean
clearState
Allows clearing of remote Adaptable State. Only invoked during StateApi.reloadInitialState() operations.
clearState?: AdaptableClearStateFunction;Default Value
undefined
Property Value
debounceStateDelay
Delay (in ms) to debounce saveState / persistState calls enabling grouping multiple sequential calls in single one (e.g. elevator doors)
Defaults to: 400. Also, the wait will be max 1000ms, at which point the save/persist calls will happen anyway.
debounceStateDelay?: number;Default Value
400
Property Value
number
loadState
Retrieves saved Adaptable State from storage or external source
loadState?: AdaptableLoadStateFunction;Property Value
persistState
Handles the actual storage of state to localStorage, server, etc. Called after saveState() to store the prepared state.
persistState?: AdaptablePersistStateFunction;Property Value
saveState
Transforms state before saving to storage. Called before persistState().
saveState?: AdaptableSaveStateFunction;