A little cleanup

This commit is contained in:
Dan Holmsand 2014-02-11 00:15:01 +01:00
parent 805264ea61
commit a1ea281fc5
1 changed files with 6 additions and 6 deletions

View File

@ -11,20 +11,20 @@
(defn running [] @-running)
(defn capture-derefed [f obj]
(set! (.-captured obj) nil)
(set! (.-cljsCaptured obj) nil)
(binding [*ratom-context* obj]
(f)))
(defn captured [obj]
(let [c (.-captured obj)]
(set! (.-captured obj) nil)
(let [c (.-cljsCaptured obj)]
(set! (.-cljsCaptured obj) nil)
c))
(defn- notify-deref-watcher! [derefable]
(let [obj *ratom-context*]
(when-not (nil? obj)
(let [captured (.-captured obj)]
(set! (.-captured obj)
(let [captured (.-cljsCaptured obj)]
(set! (.-cljsCaptured obj)
(conj (if (nil? captured) #{} captured)
derefable))))))
@ -118,7 +118,7 @@
(run [this]
(let [oldstate state
res (capture-derefed f this)
derefed (.-captured this)]
derefed (captured this)]
(when (not= derefed watching)
(-update-watching this derefed))
(when-not active?