-
Notifications
You must be signed in to change notification settings - Fork 252
Enhance usePaginationModel with guard functions #3835
Copy link
Copy link
Open
Description
🚀 Feature Proposal
Enable guard function to usePaginationModel similar to existing model patterns like useSelectModel
Motivation
We have an internal discard changes confirmation that appears when an action can navigate away. Pagination is one of them so we need a way to stop the internal selection of changing pages under certain conditions.
Example
const model = usePaginationModel({
lastPage,
shouldPageChange: () => {
if(discardChanges === true) return false;
return true;
},
onPageChange: number => console.log(number),
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🆕 New