Ff153 Add IDBRecord#44540
Conversation
|
Preview URLs (5 pages)
External URLs (3)URL:
URL:
URL:
(comment last updated: 2026-07-03 02:48:25) |
dipikabh
left a comment
There was a problem hiding this comment.
Thanks, @hamishwillee.
I have a few comments and questions for you - let me know if any miss the mark.
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org> Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2af42fe to
ab9a365
Compare
|
Thanks @dipikabh |
dipikabh
left a comment
There was a problem hiding this comment.
Thanks a lot for the updates, @hamishwillee. They're looking good.
Note I've flagged some things in the example code, which are a carryover from getAllRecords(). I'll leave it up to you if you want to fix them in IDBRecord now or in a follow-up when the other pages can also be fixed together.
| const myRecords = (objectStore.getAllRecords({ | ||
| query, | ||
| count: 100, | ||
| direction: "prev", | ||
| }).onsuccess = (event) => { |
There was a problem hiding this comment.
-
you may want to consider splitting this code into two statements, that is, one for assigning to
myRecordsand a separate one formyRecords.onsuccess -
transactionin l41 is not defined here. Maybe we can borrow the transaction setup lines of code from https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/get#examples?
I realize both these issues exist in the examples we have on the two getAllRecords() pages (Looking at the history, I had done the editorial review of those methods when they were first added in #41398)
There was a problem hiding this comment.
Thanks @dipikabh
- I have split all the exmaples as you suggested - its a much cleaner pattern.
- Also added as event listeners which is how you are supposed to do these things. Modified in all three examples in same way (modulo the difference in index vs object store).
- I defined
transactionbut NOT the database that is needed for it (at some point you get to where all the infrastructure means you no longer have an example that is "basic usage). In any case, I fixed the issue that this was not defined by noting explicitly that this was not done, rather than just not mentioning it. - I have similarly updated the examples in the IDBRequest and record to use the addEventListener. Didn't take it further than that for those.
Updates all in ddc1b17
I think it is good. Leaving in case you want to scan it again.
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>
FF153 Adds support for
IDBIndex.getAllRecords()andIDBObjectStore.getAllRecords().Like all read-write methods in IDB these return an
IDBRequestinstance, which on success include the "result" of the request in the results object. For these methods theresultis an array ofIDBRecordobjects.The
IDBRecordis in the IDL as an interface. It is more like a dictionary, but in line with MDN policy I've added it as its own interface and cross linked everywhere.There are a couple of comments inline.
Related docs can be tracked in #44449