It looks okay now.
This commit is contained in:
@@ -3,11 +3,20 @@
|
||||
[re-frame.core :as re-frame]
|
||||
[auto-ap.events :as events]
|
||||
[auto-ap.views :as views]
|
||||
[auto-ap.config :as config]))
|
||||
[auto-ap.config :as config]
|
||||
[auto-ap.routes :as routes]
|
||||
[pushy.core :as pushy]
|
||||
[bidi.bidi :as bidi]))
|
||||
|
||||
(defn- parse-url [url]
|
||||
(.log js/console "test" (bidi/match-route routes/routes url))
|
||||
(bidi/match-route routes/routes url))
|
||||
|
||||
(defn- dispatch-route [matched-route]
|
||||
(re-frame/dispatch [::events/set-active-page (:handler matched-route)]))
|
||||
|
||||
(defn dev-setup []
|
||||
(when config/debug?
|
||||
(when true
|
||||
(enable-console-print!)
|
||||
(println "dev mode")))
|
||||
|
||||
@@ -17,7 +26,9 @@
|
||||
(.getElementById js/document "app")))
|
||||
|
||||
(defn ^:export init []
|
||||
(re-frame/dispatch-sync [::events/initialize-db])
|
||||
(dev-setup)
|
||||
|
||||
(pushy/start! (pushy/pushy dispatch-route parse-url))
|
||||
(re-frame/dispatch-sync [::events/initialize-db])
|
||||
(mount-root))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user