Skip to content

Change computed pagination API design #724

Open
@DevNatan

Description

@DevNatan

Static, Lazy and Computed pagination should all be able to use update(), forceUpdate() and navigation in the same way. The way pagination is done today is impossible to use those features with computed pagination.

Navigation feature depends on update triggers and early calculation of pages.

Since the use case of computed pagination is to create "chunked" paginations ex.: hit a paginated endpoint with hundreds of data, we must provide a way to specify page parameters somehow when data is being loaded, in a computed pagination.

The way computed pagination is working today is the expected behavior but it's not working the way people expect how it should behave because its not documented. Document that:

  • Static: to load data that is cached somewhere like access a map of things like Player abilities.
  • Lazy: to load data that would cause trouble if loaded a lot of times like loading a file or hiting a database.
  • Computed: to load data that we do not have the information about the size of, like hiting a paginated endpoint or hiting database with a query that has LIMIT and OFFSET.

Objective

Change computed pagination method signature to allow specify pages count, size, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-designMajor changes to the high-level API

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions