Storage - Infomaker/Dashboard-Plugin GitHub Wiki

Storage

To store or retrieve persistent data, use the store class available in application, widget, agent or modal (classes).

Store persistent data

this.store("myKeyValue", {
    foo: "bar"
})

First parameter is the key value for your stored data. The second parameter is the data you want to store, this can be any data that can be serialized and stored as a string.

Retrieve persistent data

this.store("myKeyValue", response => {
    console.log(response.data)
})

First parameter is the key value for your stored data. The second parameter is a callback that will be called when you recieve data.

To store or retrieve cached data, use the cache class available in application, widget, agent or modal (classes).

Cache data

this.cache("myKeyValue", {
    foo: "bar"
})

First parameter is the key value for your cached data. The second parameter is the data you want to cache, this ca n be any data that can be serialized and cached as a string.

Retrieve cached data

this.cache("myKeyValue", data => {
    console.log(data)
})

First parameter is the key value for your cached data. The second parameter is a callback that will be called when you recieve data.