Skip to content
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 in named routes #63

Open
ostronom opened this issue Feb 20, 2015 · 4 comments
Open

Query params in named routes #63

ostronom opened this issue Feb 20, 2015 · 4 comments

Comments

@ostronom
Copy link

Given this route definition:

(defroute exchange-link "/exchange" [z]
  (println "route params" z))

and this invokation:

(sec/dispatch! "/exchange?a=b")

I'm getting:

route params nil

instead of

route params {:query-params ... }
(defroute exchange-link "/exchange" {:keys [query-params]}
  (println "route params" query-params))

gives the same result.

@noprompt
Copy link
Collaborator

That seems interesting considering this is thoroughly tested. Some more context would be helpful (if this is still an issue).

@julienfantin
Copy link

The secretary readme describes a google closure history config that discards the query params from the token. This is visible if you log the navigation event.

A better alternative is described here: https://gist.github.com/pleasetrythisathome/d1d9b1d74705b6771c20#file-browser-cljs-L11

@noprompt
Copy link
Collaborator

The secretary readme describes a google closure history config that discards the query params from the token.

@julienfantin I don't recall this being an issue but if it is we apologize. If you'd like to update the README and examples with something better please do.

@mking
Copy link

mking commented Dec 18, 2015

FWIW I just ran into this issue. query-params were coming back as nil until I used the history config in the above gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants