-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Query params #9
Comments
I don't think so, no. The query prams are easily accessed on Unlike pathnames and All that stuff (parsing) happens inside the route handler, and only once the pathname has been matching the first place... And should only happen if you wanted to happen. import { decode } from 'qss';
navaid()
.on('/users/:id?', params => {
console.log('user id, if any', params.id);
const { sort, filter, limit } = decode(location.search.substring(1));
// ... Or use UURLSearchParams if you want
// It's your choice, as it should be
}) |
Adding a query string currently breaks the path matching, so to use it navaid needs to at least drop it from |
Thanks for the report @jacwright 👍 |
Would you be open to a contribution that supported query params?
It would be removing the query string from the end of the
uri
sent torun
before looking for matching routes, then splitting they query string into its key-value pairs and sending those as a second parameter to the route function. E.g.The text was updated successfully, but these errors were encountered: