- convert :no-history-while from dispatch to direct call off-the-record!

This commit is contained in:
hipitihop 2015-01-06 16:05:39 +10:00
parent d733c9c6b1
commit 79e3f08d96
1 changed files with 5 additions and 8 deletions

View File

@ -24,6 +24,11 @@
(historian/clear-history!)
(historian/trigger-record!))
(defn off-the-record!
"evaluate db mutation-fn without creating a history record"
[db mutation-fn]
(off-the-record (reset! db (mutation-fn db))))
;; -- subscriptions -----------------------------------------------------------------------------
@ -55,11 +60,3 @@
(fn
[_ _]
(historian/redo!))) ;; (dispatch [:undo])
(handlers/register
:no-history-while
(fn
[db [_ mutation-fn]]
(off-the-record
(reset! db (mutation-fn @app-db)))))