         reaction (Reaction. f nil dirty nil nil
                             runner on-set on-dispose nocache)]
     (when-not (nil? capture)
+      (when (dev?)
+        ;; TODO: Add test
+        (set! (.-ratomGeneration reaction)
+              (.-ratomGeneration capture)))
       (when-some [c (aget capture cache-key)]
+        (aset capture cache-key nil)
         (aset reaction cache-key c)))
-    ;; TODO: get rid of reaction-id
-    (when-some [rid (some-> capture .-reaction-id)]
-      (set! (.-reaction-id reaction) rid))
     (when-not (nil? derefed)
       (warn "using derefed is deprecated"))
     (when-not (nil? derefs)
-      (when (dev?)
-        (set! (.-ratomGeneration reaction)
-              (.-ratomGeneration derefs)))
       (._update-watching reaction derefs))
     reaction))
 


(declare make-reaction)

(def ^{:private true :const true} cache-key "reaction-cache")

(defn- cached-reaction [f o k obj destroy]
  (let [m (aget o cache-key)

               (if (identical? (aget x i) (aget y i))
                 (recur (inc i))
                 false))))))

(defn- check-watches [old new]
  (when debug
