mirror of https://github.com/status-im/reagent.git
Use run instead of deref
This commit is contained in:
parent
0634806104
commit
31b06375ef
|
@ -212,16 +212,14 @@
|
|||
(set! ra.norun? true)
|
||||
(doseq [w ra.watching]
|
||||
(when (and (reaction? w)
|
||||
(not (identical? (.-dirty? w) clean)))
|
||||
(-deref w)))
|
||||
(not (== (.-dirty? w) clean)))
|
||||
(ra-check-clean w)
|
||||
(when-not (== (.-dirty? w) clean)
|
||||
(run w))))
|
||||
(set! ra.norun? false)
|
||||
(when (== ra.dirty? maybe-dirty)
|
||||
(set! ra.dirty? clean))))
|
||||
|
||||
(defn- ra-run-check [ra]
|
||||
(binding [*ratom-context* (js-obj)]
|
||||
(ra-check-clean ra)))
|
||||
|
||||
(defn- ra-handle-change [ra sender oldval newval]
|
||||
(when ra.active?
|
||||
(let [old-dirty ra.dirty?]
|
||||
|
@ -232,9 +230,7 @@
|
|||
is-dirty)))
|
||||
(if (and ra.auto-run (not ra.norun?))
|
||||
(do
|
||||
;; FIXME: is this correct?
|
||||
(when (== ra.dirty? maybe-dirty)
|
||||
(ra-run-check ra))
|
||||
(ra-check-clean ra)
|
||||
(when-not (== ra.dirty? clean)
|
||||
((or ra.auto-run run) ra)))
|
||||
(when (== old-dirty clean)
|
||||
|
|
Loading…
Reference in New Issue