A little cleanup

This commit is contained in:
Dan Holmsand 2015-09-11 18:23:18 +02:00
parent b1acdea090
commit 2895c9bed7

View File

@ -198,7 +198,7 @@
(defprotocol IComputedImpl (defprotocol IComputedImpl
(-peek-at [this]) (-peek-at [this])
(-check-clean [this]) (^boolean -check-clean [this])
(-handle-change [this sender oldval newval]) (-handle-change [this sender oldval newval])
(-update-watching [this derefed])) (-update-watching [this derefed]))
@ -261,9 +261,10 @@
(set! norun? true) (set! norun? true)
(doseq [w watching] (doseq [w watching]
(when (and (instance? Reaction w) (when (and (instance? Reaction w)
(not (== (.-dirtyness w) clean))) (not (-check-clean w)))
(when-not (-check-clean w) (if-some [ar (.-auto-run w)]
((or (.-auto-run w) run) w)))) (ar w)
(run w))))
(set! norun? false) (set! norun? false)
(when (== dirtyness maybe-dirty) (when (== dirtyness maybe-dirty)
(set! dirtyness clean))) (set! dirtyness clean)))
@ -277,13 +278,13 @@
dirty)] dirty)]
(when (> new-dirty old-dirty) (when (> new-dirty old-dirty)
(set! dirtyness new-dirty) (set! dirtyness new-dirty)
(if (some? auto-run) (if-some [arun auto-run]
(when-not norun? (when-not norun?
(if-not (identical? auto-run run) (when-not (and (identical? arun run)
(auto-run this) (-check-clean this))
(when-not (-check-clean this) (arun this)))
(auto-run this)))) (-notify-watches this state state))))
(-notify-watches this state state))))) nil)
(-update-watching [this derefed] (-update-watching [this derefed]
(doseq [w derefed] (doseq [w derefed]