Fork me on GitHub
#reitit
<
2019-10-17
>
David Pham05:10:37

Did you try to use the hash function has predicate?

ataggart15:10:41

Does anyone know if the reitit api docs are published anywhere? The guide is nice, but doesn't serve as a useful reference.

ataggart16:10:18

Heh, I mean api docs for reitit.

ataggart16:10:00

Linking to that reference from the readme and/or guide may help future folks.

ikitommi16:10:24

would you like do a PR of that?

ataggart16:10:00

Heh, sure, once I get through reviewing my work PRs. 🙂

ataggart16:10:42

Somewhat relatedly, it would be good to: 1. Include protocol methods in the namespace index 2. Use docstings for protocol methods This all came about because we were inadvertently reimplementing reitit.core/route-names, and only caught it when reading the guide on name-based routing. That fn (and all Router protocol methods) are otherwise undocumented: https://cljdoc.org/d/metosin/reitit/0.3.10/api/reitit.core#Router

drewverlee21:10:02

How do you get the current path, specifically path params, from the router or history?

drewverlee21:10:46

i see the path in the history -> last fragment, but is there a way to ask for the path prams specifically?

drewverlee23:10:11

(rf/match-by-path router 
                               "/user/5d965755-89b5-472c-9998-9431f1752827/medications")
Evals to nothing. As in nothing shows when i eval it. But

drewverlee23:10:36

but..

(:parameters (rf/match-by-path router 
                               "/user/5d965755-89b5-472c-9998-9431f1752827/medications"))
evals to
;; => {:path {:user-id "5d965755-89b5-472c-9998-9431f1752827"}, :query {}}

drewverlee23:10:06

That probably isnt a reitit specific question, but im not sure where to start.