Skip to content

Lazy load LocalDb (LocalStorage cache) #16

@Zren

Description

@Zren

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)
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions