Polish example

This commit is contained in:
Tommi Reiman 2018-12-17 20:54:36 +02:00
parent 492d5e2f2b
commit 7c7b8dd8a5

View file

@ -52,23 +52,23 @@
[:pre (with-out-str (fedn/pprint @match))]])
(def routes
(rf/router
["/"
[""
[["/"
{:name ::frontpage
:view home-page}]
["about"
["/about"
{:name ::about
:view about-page}]
["item/:id"
["/item/:id"
{:name ::item
:view item-page
:parameters {:path {:id s/Int}
:query {(s/optional-key :foo) s/Keyword}}}]]
{:data {:coercion rsc/coercion}}))
:query {(s/optional-key :foo) s/Keyword}}}]])
(defn init! []
(rfe/start! routes
(rfe/start!
(rf/router routes {:data {:coercion rsc/coercion}})
(fn [m] (reset! match m))
{:use-fragment true})
(r/render [current-page] (.getElementById js/document "app")))