Fork me on GitHub

I’m looking at reitit.frontend.controllers — is there a way to “hang” some data to the match object? Or are the start/stop functions only for side effects?


Looking at the code, it seems not.


I’d look at the identity function, it takes a match and returns an arbitrary value, so a good place to hook in some extra data before it gets passed to start/stop


Apply-controllers is also just a 50 lines of code and you are calling it from your route change handler, you could just call your own code from the same place, no need to use controllers for this.


@juhoteperi yeah this is what I ended up doing. Literally 2 lines of code 😄

👍 4

Is there a way to have optional query parameters when coercing with clojure.spec? I have the following, but the request fails if parameters are missing:

{:get {:parameters {:query {:limit int?
                            :offset int?}}
Edit: Nevermind, I solved it by using your ``