mirror of https://github.com/status-im/reagent.git
wip
This commit is contained in:
parent
6c345db29e
commit
be7bb69548
|
@ -247,17 +247,19 @@
|
|||
IComputedImpl
|
||||
(-handle-change [this sender oldval newval]
|
||||
(when active?
|
||||
(let [old-dirty dirty?]
|
||||
(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)
|
||||
(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)))
|
||||
(-notify-watches this state state))))
|
||||
;; (when (and active? (not (identical? oldval newval)))
|
||||
;; (set! dirty? is-dirty)
|
||||
;; ((or auto-run run) this))
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue