Storage
Persistent storage.
Permission
storage permission is required.
{
//...
"plugin": {
"permissions": {
"scopes": ["storage"]
}
}
}Usage
API
Unlike store , storage handles nested values out of the box.
$storage.set("foo.bar", 1)
$storage.set("foo.baz", "2")
$storage.has("foo") // true
$storage.get<number>("foo.bar") // 1
$storage.get<Record<string, any>>("foo") // { "bar": 1, "baz": "2" }
$storage.set("foo", "bar")
$storage.get("foo") // bar
$storage.watch("foo", (value) => {})Example
Make sure your storage doesn't grow too big by doing some cleanup.
Good to know
The plugin storage is deleted when the plugin is uninstalled.
Last updated