getStoreData
Description
Reads a value stored permanently with $app.setStoreData(). Returns null when there is no value.
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | String | Key name of the data to look up |
Returns
dynamic — the stored value, or null if there is none
Notes
- It reads from disk (
LucyStorage), so it is relatively slower thangetSharedData. - The value survives an app restart.
Example
// Restore the saved theme mode at app startup
var themeMode = $app.getStoreData("THEME_MODE");
if (themeMode != null) {
$app.changeTheme(Number(themeMode));
}
Related
$app.setStoreData(key, data)$app.removeStoreData(key)$app.getSharedData(sharedKey)