Rework todomvc history
This commit is contained in:
parent
c50f88caf0
commit
ec0b383ed3
|
@ -13,17 +13,16 @@
|
||||||
|
|
||||||
(enable-console-print!)
|
(enable-console-print!)
|
||||||
|
|
||||||
;; -- Routing -----------------------------------------------------------------
|
;; -- Routes and History ------------------------------------------------------
|
||||||
|
|
||||||
(defroute "/" [] (dispatch [:set-showing :all]))
|
(defroute "/" [] (dispatch [:set-showing :all]))
|
||||||
(defroute "/:filter" [filter] (dispatch [:set-showing (keyword filter)]))
|
(defroute "/:filter" [filter] (dispatch [:set-showing (keyword filter)]))
|
||||||
|
|
||||||
(def history (History.))
|
(def history
|
||||||
|
(doto (History.)
|
||||||
(events/listen history EventType.NAVIGATE
|
(events/listen EventType.NAVIGATE
|
||||||
(fn [e] (secretary/dispatch! (.-token e))))
|
(fn [event] (secretary/dispatch! (.-token event))))
|
||||||
|
(.setEnabled true)))
|
||||||
(.setEnabled history true)
|
|
||||||
|
|
||||||
|
|
||||||
;; -- Entry Point -------------------------------------------------------------
|
;; -- Entry Point -------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue