Re: [w3ctag/spec-reviews] Indexed DB getAll(), openKeyCursor() and objectStoreNames (#84)

Everything in IDB returns an IDBRequest, which populates the `result` property when the request is completed. (This is what happens when you implement an async API before Promises are added to the DOM, and don't have a time machine handy.) `getAll()` was specified to yield (via `request` property) an Array of results.

I think the comments here and in the TAG minutes hint at a handful of inter-related questions.

* Q: Why do we need `getAll()` versus some iterable type? A: That's what IDBCursor is for, but the performance (as designed) is poor for many scenarios since script must explicitly pull the next result via `continue()` (vs. a push-type async iterator)
* Q: Should it be an Array or some other type? Frozen? A: shipped as just Array. Could probably be made FrozenArray. Today, the `result` on IDBRequest - which can be any cloneable data - is not frozen (etc) 
* Q: Do we want to be extending the API like this, vs. exploring async iterators A: This was such a common request/clear performance win that it made sense. In parallel, exploring adapting IDB to work with Promises (see https://github.com/inexorabletash/indexeddb-promises) and pursuing Observables for pull-type iteration (i.e. adapting cursors) makes sense as those firm up.



---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/spec-reviews/issues/84#issuecomment-234098466

Received on Wednesday, 20 July 2016 22:06:32 UTC