Skip to main content

getStoreData

Description

Reads a value stored permanently with $app.setStoreData(). Returns null when there is no value.

Parameters

ParameterTypeDescription
keyStringKey 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 than getSharedData.
  • 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));
}
  • $app.setStoreData(key, data)
  • $app.removeStoreData(key)
  • $app.getSharedData(sharedKey)