wip: sort of working

This commit is contained in:
Dan Holmsand 2015-08-31 10:18:21 +02:00
parent 1782ff1832
commit 043c8b0dee
1 changed files with 9 additions and 1 deletions

View File

@ -203,7 +203,7 @@
(deftype Reaction [f ^:mutable state ^:mutable dirty? ^:mutable active?
^:mutable watching ^:mutable watches
auto-run on-set on-dispose]
^:mutable auto-run on-set on-dispose]
IAtom
IReactiveAtom
@ -290,6 +290,14 @@
IDeref
(-deref [this]
(when (== dirty? maybe-dirty)
(let [oldauto auto-run]
(set! auto-run nil)
(doseq [w watching]
(-deref w))
(set! auto-run oldauto))
(when (== dirty? maybe-dirty)
(set! dirty? clean)))
(if (or auto-run (some? *ratom-context*))
(do
(notify-deref-watcher! this)