You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, you can store a lot of data in LocalForage sorted by key, but you can't easily "slice" the data to get a subset of those items. The only way is to call iterate(), which currently reads the entire database into memory and therefore is not super efficient.
My proposal: enhance the iterate() API by allowing users to do:
If neither startkey/endkey are specified, then you get the old behavior. If only one is specified, you get startkey (similar to Array.prototype.slice()). To keep things simple, both of them should be inclusive, and then users can get exclusive behavior by just skipping those values in their iteratorCallback function.
What do you all think? If I have some spare cycles and if this is a popular proposal, I could try to take a crack at it.
The text was updated successfully, but these errors were encountered:
Currently, you can store a lot of data in LocalForage sorted by key, but
you can't easily "slice" the data to get a subset of those items. The only
way is to call iterate(), which currently reads the entire database into
memory and therefore is not super efficient.
My proposal: enhance the iterate() API by allowing users to do:
If neither startkey/endkey are specified, then you get the old behavior.
If only one is specified, you get startkey (similar to
Array.prototype.slice()). To keep things simple, both of them should be
inclusive, and then users can get exclusive behavior by just skipping those
values in their iteratorCallback function.
What do you all think? If I have some spare cycles and if this is a
popular proposal, I could try to take a crack at it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #565
Currently, you can store a lot of data in LocalForage sorted by key, but you can't easily "slice" the data to get a subset of those items. The only way is to call
iterate()
, which currently reads the entire database into memory and therefore is not super efficient.My proposal: enhance the
iterate()
API by allowing users to do:If neither startkey/endkey are specified, then you get the old behavior. If only one is specified, you get
startkey
(similar toArray.prototype.slice()
). To keep things simple, both of them should be inclusive, and then users can get exclusive behavior by just skipping those values in theiriteratorCallback
function.What do you all think? If I have some spare cycles and if this is a popular proposal, I could try to take a crack at it.
The text was updated successfully, but these errors were encountered: