Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Design change: Decouple the per-page count #1

Open
GeReV opened this issue Jun 14, 2012 · 0 comments
Open

Design change: Decouple the per-page count #1

GeReV opened this issue Jun 14, 2012 · 0 comments

Comments

@GeReV
Copy link
Owner

GeReV commented Jun 14, 2012

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant