Fork me on GitHub
#juxt
<
2015-12-11
>
jannis17:12:50

Hi! Am I in the right place if I want to ask something about bidi?

malcolmsparks22:12:48

Hi - ask away! I saw some chatter on #C03S1L9DN earlier today, if you can explain what you're trying to achieve I'd love to help

malcolmsparks22:12:06

or you can always raise an issue on gh, or email me direct at <mailto:[email protected]|[email protected]>

malcolmsparks22:12:52

now that bidi has made the jump to cljc (rather than cljx) it's a lot easier to hack on it, so I'm planning to make some improvements to the cljs side

jannis23:12:09

I solved my problem using tag, but the routes are not pretty 😉

jannis23:12:19

Basically, I wanted to the routes /[#"[^]*" :state]/requirements and /[#"^]*" :state]/requirements/[#".*" :names] to map to the same handler but with different parameters. I had that working. But I also wanted to use bidi.router/set-location! to generate URLs from locations and have it automatically decide which of the two URLs above to generate depending on whether :names is present in the :route-params passed to set-location!.

jannis23:12:05

I've solved it by using tags for the two match handlers and passing a location to set-location! with :handler set to the corresponding tag (e.g. :expanded-requirements for the form with :names), so now it generates the right URL. Is this possible without tags or with simpler rules?