plasma-applet-githubissues
plasma-applet-githubissues copied to clipboard
Lazy load LocalDb (LocalStorage cache)
Looks like qml-module-qtquick-localstorage isn't a default package. I didn't realized that as I forgot to release v3 for over a year.
Something like this to wrap the LocalDb functions if the item was loaded properly. If it has not (error loading the localstorage module) then it just calls fetch.
// LocalCache.qml
Loader {
id: cache
source: "LocalDb.qml"
function get(key, fetchCallback, doneCallback) {
if (item) {
item.get(key, fetchCallback, doneCallback)
} else {
fetchCallback(key, doneCallback)
}
}
}