funcool / bide

A simple routing library for ClojureScript
BSD 2-Clause "Simplified" License
131 stars 20 forks source link

Nested query params #19

Open rrrnld opened 6 years ago

rrrnld commented 6 years ago

Hi!

I have a question about how to best approach this; I'm basically trying to encode redirection data into a route. I thought it would go like this:

;; construct the login route and try to reconstruct the original data
(r/resolve router ::login {} {:redirect [::artist-view {:id 1}]})
;; => "/?redirect=artist-view&redirect=%7B%3Aid%201%7D"
(r/match router *1)
;; => [:user/login nil {:redirect ["artist-view" "{:id 1}"]}]

As you can see the structure of the vector gets destroyed. Can I hook into the encoding somehow? Is there a better approach that I'm not seeing?

jiangts commented 5 years ago

+1. Nested query parameters failed for me too.