                (if (identical? (aget x i) (aget y i))
                  (recur (inc i))
                  false))))))
-
-(def ^:private reaction-counter 0)
-
-(defn- reaction-key [r]
-  (if-some [k (.-reaction-id r)]
-    k
-    (->> reaction-counter inc
-         (set! reaction-counter)
-         (set! (.-reaction-id r)))))
 
 (defn- check-watches [old new]
   (when debug

  (-pr-writer [a w opts] (pr-atom a w opts (str "Reaction " (hash a) ":")))

  IHash
  (-hash [this] (reaction-key this)))


(defn make-reaction [f & {:keys [auto-run on-set on-dispose derefed no-cache

        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)))
    (when-not (nil? derefed)
      (warn "using derefed is deprecated"))
    (when-not (nil? derefs)
      (._update-watching reaction derefs))
    reaction))

