Comments (6)
Hi there, thanks for reporting this.
Ok what driver does the above happen?
from localforage-observable.
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.
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.
I've started converting this repo to Typescript. I will continue during the next weekend and hopefully will also fix this.
from localforage-observable.
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.
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)
- Implement a getItemObservable method
- Error Building on Ionic 2 HOT 3
- Support for localforage instances HOT 1
- ReferenceError: Observable is not defined HOT 2
- I'm interested in what this adds to localForage's promise based api? HOT 1
- ReferenceError: Observable is not defined HOT 2
- IE 11 toString - Invalid calling object HOT 4
- [Feature Request] Provide a way to customize cross tab observer implementation
- [Question] Observe this same store from different instances
- How to install / what's the npm package name?
- How to merge multiple observables in to one? HOT 7
- localforage.setItem in a promise won't fire Observable with rxjs HOT 14
- Add support for cross-tab notifications HOT 10
- Use LocalForage-observable in an es6/typescript environment HOT 19
- Fix import window from 'window' error HOT 1
- Add proper Typings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from localforage-observable.