         nocache (if (nil? no-cache) false no-cache)
         reaction (Reaction. f nil dirty nil nil
                             runner on-set on-dispose nocache)]
+    (when-not (nil? capture)
+      (when-some [c (aget capture cache-key)]
+        (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)

  (-deref [this]
    (if-some [r reaction]
      (-deref r)
      (cached-reaction #(apply f args) (goog/getUid f) args this nil)))

  IEquiv
  (-equiv [_ other]


(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)
        m (if (nil? m) {} m)
        r (get m k)]
    (if-not (nil? r)
      (-deref r)
      (if (nil? *ratom-context*)
