Giter Club home page Giter Club logo

Comments (6)

thgreasi avatar thgreasi commented on June 8, 2024

Hi there, thanks for reporting this.
Ok what driver does the above happen?

from localforage-observable.

seb-ster avatar seb-ster commented on June 8, 2024

I havn't specified a driver, but the 'clear-test' database appears in the Indexed DB in the browser.

I forgot to mention the versions for localforage and localforage-observable i was using:

localforage: 1.5.3
localforage-observable: 1.4.0

I updated localforage to version 1.6.0 but the issue remains

from localforage-observable.

thgreasi avatar thgreasi commented on June 8, 2024

It seems that it only works when change detection is off. I don't remember having a specific reasoning for that case or doing this on purpose. Will continue investigating and will probably also add proper tests.
Once again thanks for the report.

from localforage-observable.

thgreasi avatar thgreasi commented on June 8, 2024

I've started converting this repo to Typescript. I will continue during the next weekend and hopefully will also fix this.

from localforage-observable.

seb-ster avatar seb-ster commented on June 8, 2024

So, i came back to this issue as i ran into some problems with change detection being off.

A change event has an object as payload. The object has, oldValue and newValue properties.
In case of the clear() method oldValue and newValue properties both are null. Even if data was definitly cleared from storage.
Could it be that change detection is not working because oldValue does not correctly reflect the old values? oldValue and newValue are both null, giving the impression no change happened?

What should the value of oldValue be in case of a clear() event, as it affects multiple old values?
Well, the value of the key property is undefined.
As per LocalForage Documentation undefined is not used in storage. So the property oldValue can never be undefined.

My suggestion:
Why not use the undefined value on oldValue in case of the clear() method?
Which would be consistent with the key property value.

from localforage-observable.

thgreasi avatar thgreasi commented on June 8, 2024

When change detection is off, we actually don't populate the oldvalue at all, we instead just listen for the various localforage method calls and fill the newvalue with their payload.
Status update: I've finished converting this repo to typescript and configured karma with headless chrome as well. Didn't have time for the last 3 weekends but will resume soon.

from localforage-observable.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.