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

Design change: Decouple the per-page count #1

@GeReV

Description

@GeReV

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions