It looks okay now.

This commit is contained in:
Bryce Covert
2017-12-07 15:25:39 -08:00
parent 5b578c11e8
commit 505ccfba8e
10 changed files with 180 additions and 98 deletions

View File

@@ -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))