Skip to content

[Feature Request] - App-indexeddb-mirror Load if offline OR data is empty #138

@derhuebiii

Description

@derhuebiii

I need this to save AJAX requests for 24 hours for the pixabay API. When the user searches manually I want to check in the locally stored requests if he did this the last 24hours. So I want to check the key without providing anything in data at this time.

I managed to get it work like this, but it would be nice if it would be a property:
<app-indexeddb-mirror ... load-from-cache-when-data-empty="true"></app-indexeddb-mirror>

Changing to:
if (this.online && this.data.length != 0) {
and:

if (this.online || !this.client.supportsMirroring) {

to:
if ((this.online & this.data.length != 0) || !this.client.supportsMirroring) {
solves it for me.

Maybe this can be enhanced as a feature for the element?
Load cached data if offline OR no data available in "live-data"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions