Closed neonstalwart closed 10 years ago
sample code...
store
.range(existingItems.length, existingItems.length + count)
.forEach(function (item) {
// ...
})
The range
method no longer exists, we are using fetchRange() now (which behaves like fetch()). What type of range parameters are you using (headers, named query parameters, or limit())?
i'm using rql - so limit()
is my range mechanism. i guess range
should have been removed from Request if it no longer exists :wink:
will fetchRange
hurt my use case since i want to do a forEach over a range?
Yes, fetchRange will hurt your use case, if you want to do a (safe) forEach, as fetchRange returns (a promise to) an array. We had talked about adding a forEach to the value result returned from fetch{Range} for convenience. As it is, you have to wait for the promise and iterate over the plain array.
the ability to stream results would be very attractive if the API could support it. technology is advancing to where it is becoming possible so is there some way to not have the API be the limiting factor?
Yes, having forEach available on the result of fetchRange() does seem desirable. Also, https://github.com/SitePen/dstore/commit/1fcf181c5173af25bc34fdca539ead1dd9b0787c
thanks - 1fcf181 is enough to close this issue out.
something in this push (https://github.com/SitePen/dstore/compare/5d12808059...32540ce9bd) just broke
_renderRangeParams
(https://github.com/SitePen/dstore/blob/master/Request.js#L185)cc @brandonpayton, @kriszyp