This commit is contained in:
Dan Holmsand 2015-08-31 10:59:59 +02:00
parent 6c345db29e
commit be7bb69548
2 changed files with 14 additions and 11 deletions

View File

@ -247,17 +247,19 @@
IComputedImpl
(-handle-change [this sender oldval newval]
(when active?
(set! dirty? (max dirty?
(if (identical? oldval newval)
maybe-dirty is-dirty)))
(if auto-run
(do
;; FIXME: is this correct?
(binding [*ratom-context* this]
(-check-clean this))
(when (> dirty? clean)
((or auto-run run) this)))
(-notify-watches this state state)))
(let [old-dirty dirty?]
(set! dirty? (max dirty?
(if (identical? oldval newval)
maybe-dirty is-dirty)))
(if auto-run
(do
;; FIXME: is this correct?
(when (== dirty? maybe-dirty)
(binding [*ratom-context* (js-obj)]
(-check-clean this)))
(when-not (== dirty? clean)
((or auto-run run) this)))
(-notify-watches this state state))))
;; (when (and active? (not (identical? oldval newval)))
;; (set! dirty? is-dirty)
;; ((or auto-run run) this))

View File

@ -119,6 +119,7 @@
(reset! val 1)
(reset! val 2)
(reset! val 1)
(is (= 1 @ran))
(r/flush)
(is (found-in #"val 1" div))
(is (= 2 @ran))