 (defn- ra-check-clean [ra]
   (when (== ra.dirty? maybe-dirty)
     (set! ra.norun? true)
-    (oset-for-each ra.watching
-                   (fn [w]
-                     (when (and (reaction? w)
-                                (not (== (.-dirty? w) clean)))
-                       (ra-check-clean w)
-                       (when-not (== (.-dirty? w) clean)
-                         (run w)))))
+    (doseq [w ra.watching]
+      (when (and (reaction? 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))))


  IDisposable
  (dispose! [this]
    (oset-for-each watching
                   (fn [w]
                     (remove-watch w this)))
    ;; (doseq [w watching]
    ;;   (remove-watch w this))
    (set! watching nil)
    (set! state nil)
    (set! dirty? is-dirty)


(defn running [] @-running)

(defn capture-derefed [f obj]
  (set! (.-cljsCaptured obj) nil)
  (binding [*ratom-context* obj]
