Javascript database module for Indexeddb, Web SQL and localStorage storage mechanisms supporting version migration, advanced query, SQL and transaction.
Apache License 2.0
503
stars
41
forks
source link
valuesOf(IndexIterator) with webstorage never dispatch a response #111
When using valuesOf with sessionstorage or localstorage, the deferred object seems to be lost if there is no results.
Here is a sample code :
`
var db = new ydn.db.Storage('bugfix111, { stores : [{name: 'item', keyPath: 'id', indexes : [{name:'type', keyPath:'type'}]}]}, {mechanisms: ['localstorage']});
var it = ydn.db.IndexIterator.where('item', 'type', '=', 'folder');
Hi,
When using valuesOf with sessionstorage or localstorage, the deferred object seems to be lost if there is no results. Here is a sample code : ` var db = new ydn.db.Storage('bugfix111, { stores : [{name: 'item', keyPath: 'id', indexes : [{name:'type', keyPath:'type'}]}]}, {mechanisms: ['localstorage']});
var it = ydn.db.IndexIterator.where('item', 'type', '=', 'folder');
db.values(it).then(function(r) { console.log(r); }, function(e) { console.log(e); }); `
I'm I doing something wrong or is this possibly a bug ? If it's a bug I'll give a try to submit a PR.
Thanks