If your goal is to request and display elements when requesting a page, you can do something like (pseudocode):
pages = {}
function fetch_page(n) {
if (!pages[n]) {
pages[n] = new ItemsCollection({page: n})
pages[n].fetch();
}
}
This way you save a collection for every page.
If you also need a collection of all the items so far selected, just save one - and add the downloaded items to it every time you get them from the server.
source
share