Currently, the collection holds a field named perPage which is set on initialization or on fetch, which dictates the amount of items on page.
Using this value the items are divided between Math.ceil(totalItems / perPage) different collections.
However, we might want to have 10 items displayed in one container's page, and 5 items on another container's page.
A solution to his might be changing the perPage value on the collection each time, but to accommodate, it would require either flattening the collections and dividing them again (which could be bad, since it's a sparse array), or resetting and fetching everything.
In either case, these are costly operations.
I'm looking for a way to decouple the per-page item count from the collection so as to avoid the aforementioned operations.
The major problem is working around the sparse collection.
Would love to hear any ideas.