dequelabs / dequelabs/cauldron

Feature request: handle client side pagination in usePagination hook

Open
#946 0 comments 0 reactions 0 assignees View on GitHub
info needed
Dominant language
TypeScript
Stars
127
Forks
31
Avg merge
2d 12h
Merged PRs (30d)
8

Description

It would be nice if usePagination could OPTIONALLY handle client-side pagination automatically, such as providing an array of the items on the current page so consumers do not have to implement that logic. This should be optional so that usePagination can still be used for server-side pagination.

One option for such an API is that you pass in _either_ `items` OR `totalItems` to switch between managed and unmanaged pagination. If `items` is passed in, then the hook could return `currentPageItems`, which reflects the current page's items.

An alternative to this API would be to just have two separate hooks--one for unmanaged and one for managed pagination

Contributor guide

Open the contributing guide

Research direction

Start by locating the usePagination hook and reviewing its current server-side pagination API. Compare the optional items/currentPageItems approach with the separate managed and unmanaged hooks alternative. Done means the project has an agreed API and client-side pagination behavior that remains optional for server-side consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.