-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERM-3220 Update pagination mechanisms for MCLs to work without stats #680
Conversation
CalamityC
commented
Apr 30, 2024
•
edited
Loading
edited
- create new hook for fetch with no stats
- add hasNextPage prop to usePrevNextPagination
* add pageCount property
* create new hook for fetch with no stats * add hasNextPage prop to usePrevNextPagination
* create new hook for fetch with no stats * add hasNextPage prop to usePrevNextPagination
Now the hasNextPage overwrites the canGoNext calculation if it is provided
* rename hook * set defaukt page
* remove comments * add resetPageStore function
* remove resetPageStore function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall code looks really good. Happy with the overall idea, just one small tweak requested to the queryKey
logic in useFetchCurrentAndNext.
I think it's probably out of scope for this piece of work, but it'd be kinda neat to not limit useCurrentAndNext
to just fetching 2 pages. Can it be renamed to something like "useFetchMultiplePages"? For now the logic can remain the same, but with a comment explaining that it's named like this to allow for future expansion to n pages down the line
Renamed hook to "useFetchMultiplePages", so it will be primed for any future logic to expand past just two pages. For now it will make use of the page passed in the params object Also changed out keyArray for getQueryKey which allows finer control over the queryKey for the implementing code refs ERM-3220
Quality Gate failedFailed conditions |
…680) * ERM-3220 Update pagination mechanisms for MCLs to work without stats * add pageCount property * ERM-3220 Update pagination mechanisms for MCLs to work without stats * create new hook for fetch with no stats * add hasNextPage prop to usePrevNextPagination * ERM-3220 Update pagination mechanisms for MCLs to work without stats * create new hook for fetch with no stats * add hasNextPage prop to usePrevNextPagination * refactor: Changed hasNextPage functionality Now the hasNextPage overwrites the canGoNext calculation if it is provided * refactor: Spread params tidy up * ERM-3220 Update pagination mechanisms for MCLs to work without stats * rename hook * set defaukt page * ERM-3220 Update pagination mechanisms for MCLs to work without stats * remove comments * add resetPageStore function * ERM-3220 Update pagination mechanisms for MCLs to work without stats * remove resetPageStore function * feat: useFetchMultiplePages Renamed hook to "useFetchMultiplePages", so it will be primed for any future logic to expand past just two pages. For now it will make use of the page passed in the params object Also changed out keyArray for getQueryKey which allows finer control over the queryKey for the implementing code refs ERM-3220 --------- Co-authored-by: Jack Golding <[email protected]> Co-authored-by: Ethan Freestone <[email protected]>