made it possible to change layouts.

This commit is contained in:
Bryce Covert
2017-12-19 19:31:13 -08:00
parent 043e558a51
commit b1414ebe60
6 changed files with 120 additions and 54 deletions

View File

@@ -0,0 +1,14 @@
(ns auto-ap.pushy
(:require [bidi.bidi :as bidi]
[pushy.core :as pushy]
[auto-ap.routes :as routes]
[re-frame.core :as re-frame]))
(defn- parse-url [url]
(bidi/match-route routes/routes url))
(defn- dispatch-route [matched-route]
(re-frame/dispatch [:auto-ap.events/set-active-page (:handler matched-route)]))
(def history (pushy/pushy dispatch-route parse-url))