-
-
Notifications
You must be signed in to change notification settings - Fork 227
feat: add nuqs-presets pattern hooks to registry #1216
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
base: next
Are you sure you want to change the base?
feat: add nuqs-presets pattern hooks to registry #1216
Conversation
Adds 7 production-ready pattern hooks for common URL state patterns: - use-pagination: Complete pagination with page size control - use-search: Debounced search with validation - use-sorting: Multi-column sorting with smart toggling - use-filters: Type-safe multi-filter management - use-multi-select: Array-based multi-selection - use-tabs: Type-safe tab navigation - use-date-range: Date range selection with presets All hooks maintained at: https://github.com/iHiteshAgrawal/nuqs-presets
|
@iHiteshAgrawal is attempting to deploy a commit to the 47ng Team on Vercel. A member of the Team first needs to authorize it. |
franky47
left a comment
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.
This is awesome, thanks! 🙌
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
resolved all. ready for review again. |
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.
One issue I see with the way the files are laid out is that installing multiple hooks will overwrite each other (eg: ~/hooks/types/index.ts), even though the contents are identical.
Overall, each hook should be a single file, and avoid installing multiple levels of barrel files which bring little value to the person adding it in their codebase.
We could also prefix them with the project name to avoid conflicts with possible existing userland hooks, eg ~/hooks/nuqs-presets/useFilters.ts.
Anothing thing that makes nuqs' declarative model interesting is deriving other features from parser declarations (eg: loaders for server-side, serializer to generate href strings for links etc). I need to look into how it's structured in your repo, but having those exports would be good to allow composing those definitions in userland.
Hey. I've updated the registry to address the feedback. Every hook is now a single file and self-contained. |
Adds 7 production-ready pattern hooks for common URL state patterns:
All hooks maintained at: https://github.com/iHiteshAgrawal/nuqs-presets