Pagination cursors are often derived from ID field s of list items, but not always. In the next section we'll see a slightly different approach that makes the next cursor more explicit. However, this approach leaves an important question unanswered: what cursor should we use when requesting the next page? Thanks to the predictable ordering of JavaScript object keys by insertion order, you should be able to use the id field of the last element returned by the read function as the cursor for the next request - though you're not alone if relying on this behavior makes you nervous. With this internal representation, you no longer have to worry about incoming items overwriting unrelated existing items, because an assignment to the map can only replace an item with the same id field.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |