Value store
Value store
The application maintains a variable store that can be accessed by the design. The store holds groups of key-value-pairs, with some of these groups having special meanings.
{
persistentValues: {
SELECTED_LANGUAGE: "en_us",
SCANNER_SERIAL: "1E...",
},
appSettings: {
...
}
}
Groups
Persistent values
Values in this sub-store are persistent across sessions. Once the user exits the app and reopens it, these values are loaded again.
They are generally used to hold values like the selected language, the pair scanner's serial number, or information about already-checked checkboxes.
App settings
This sub-store holds values that control the flow of the measurement process, such as the upper- and lower amount of light the scanner has to detect to start a measurement, or the minimum scanner-voltage required before emitting an error.
These values have defaults within the app, and are overwritten by this sub-store.
Additional Data
All data in this sub-store is sent to the measurement-servers once a measurement is uploaded.
Post Parameters
If a generic post-request is sent as a page-function, this sub-store is used as the post-body.
Values to send
If a post-iFrame is used, this sub-store is used as the post-body.
Temp
Store for temporary variables, used throughout the setup-process, but can otherwise be used freely by the config
Access the data
There are multiple ways to interact with this value store
- Several built-in functions, such as pairing the scanner, inherently sets values within the persistentValues-sub-store
- Config-wide settings are written into the appSettings-sub-store
- Some elements can read from / write to these stores