Improve the output of debug middleware

This commit is contained in:
mike-thompson-day8 2015-03-02 10:07:48 +11:00
parent 3e7ed53f34
commit 406cbe261c
1 changed files with 4 additions and 3 deletions

View File

@ -35,9 +35,10 @@
[db v]
(if (satisfies? IReactiveAtom db)
(str "re-frame: \"debug\" middleware used without prior \"pure\"."))
(warn "handler: " v) ;; XXX don't use warn
(let [new-db (handler db v)]
(warn "handler: " (data/diff db new-db)) ;; XXX don't use warn
(warn "event: " v) ;; XXX don't use warn
(let [new-db (handler db v)
diff (data/diff db new-db)]
(warn "it was: " (first diff) "\nis now: " (second diff)) ;; XXX don't use warn
new-db)))