Fork me on GitHub
Ivan Fedorov17:04:15

Hi fellas! Anyone has experience with using reitit in browser? I was following the frontend example

(def r1
      {:name ::page1
       {:path {:page-id keyword?}
        :query {(ds/opt :foo) string?}}}]]
    {:data {:coercion rss/coercion}}))

(r/match-by-path r1 "/app/page/timeflow")
(r/match-by-path r1 "/app/page/timeflow?foo=sss")
So for me the second match results in
#reitit.core.Match{:template "/app/page/{page-id}",
                   :data {:coercion #object[reitit.coercion.spec.t_reitit$coercion$spec36831],
                          :name :facade.routes/page1,
                          :parameters {:path {:page-id #object[cljs$core$keyword_QMARK_]},
                                       :query {{:k :foo} #object[cljs$core$string_QMARK_]}}},
                   :result {:path #object[Function], :query #object[Function]},
                   :path-params {:page-id "timeflow?foo=sss"},
                   :path "/app/page/timeflow?foo=sss"}

Ivan Fedorov17:04:31

Question being – what should I do to have the query parsed?


@ognivo Call reitit.frontend/match-by-path instead of one from reitit.core