- remove usage of historian & dependency

- update dependency to [re-frame "0.1.8"]
- use new register-pure-handler in all steps
NOTE: functional but daypart unit tests failing + history not yet working
This commit is contained in:
hipitihop 2015-03-02 17:49:03 +10:00
parent dc74e017df
commit 76068c2cb9
1 changed files with 13 additions and 5 deletions

View File

@ -23,7 +23,7 @@
(defn clear-history! (defn clear-history!
[] []
(reset! undo-list []) (reset! undo-list [])
(reset! undo-list [])) (reset! redo-list []))
(defn store-now! (defn store-now!
@ -34,22 +34,30 @@
@max-undos @max-undos
(conj @undo-list @app-db))))) (conj @undo-list @app-db)))))
(defn- undos?
[v]
(> (count v) 1))
(defn- redos?
[v]
(> (count v) 0))
;; -- subscriptions ----------------------------------------------------------------------------- ;; -- subscriptions -----------------------------------------------------------------------------
(subs/register (subs/register
:undos? :undos?
(fn handler (fn handler
; "return true is anything is stored in the undo list, otherwise false" ; "return true if anything is stored in the undo list, otherwise false"
[_ _] [_ _]
(reaction (> (count @undo-list) 1)))) (reaction (undos? @undo-list))))
(subs/register (subs/register
:redos? :redos?
(fn handler (fn handler
; "return true is anything is stored in the redo list, otherwise false" ; "return true if anything is stored in the redo list, otherwise false"
[_ _] [_ _]
(reaction (> (count @redo-list) 0)))) (reaction (redos? @redo-list))))
;; -- event handlers ---------------------------------------------------------------------------- ;; -- event handlers ----------------------------------------------------------------------------