This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-04
Channels
- # announcements (2)
- # babashka (7)
- # beginners (168)
- # boot (8)
- # cider (10)
- # clara (1)
- # clj-kondo (19)
- # cljdoc (8)
- # cljs-dev (16)
- # clojars (1)
- # clojure (208)
- # clojure-europe (10)
- # clojure-germany (1)
- # clojure-losangeles (1)
- # clojure-uk (56)
- # clojurescript (63)
- # conjure (23)
- # core-typed (2)
- # cursive (5)
- # data-science (1)
- # datomic (35)
- # emacs (1)
- # exercism (58)
- # graalvm (2)
- # graphql (1)
- # jobs (3)
- # kaocha (1)
- # lambdaisland (2)
- # malli (19)
- # meander (5)
- # off-topic (2)
- # pathom (25)
- # pedestal (3)
- # reagent (53)
- # reitit (4)
- # remote-jobs (2)
- # shadow-cljs (26)
- # spacemacs (3)
- # sql (22)
- # tools-deps (17)
Hi fellas! Anyone has experience with using reitit in browser? I was following the frontend example
(def r1
(r-fr/router
[["/app/page/{page-id}"
{:name ::page1
:parameters
{: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 {#spec-tools.data-spec.OptionalKey{: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"}
Question being – what should I do to have the query parsed?
@ognivo Call reitit.frontend/match-by-path
instead of one from reitit.core
@juhoteperi worked! Thanks!