You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: