 
 (def fwatch-binding-info
   (BindingInfo.
-   #(.rawDeref %) #(.addFWatch % %2 %3) #(.removeFWatch % %2) #(.clean %) #(.dispose %)))
+   #(.rawDeref %) #(.addFWatch % %2 %3) #(.removeFWatch % %2) #(.clean %)))
 
 (defn- make-register-dep [rx]
   (fn do-register-dep [dep id binding-info]

  (-update! [this key f args])
  (-update-in! [this ks f args])
  (-assoc-in! [this ks v]))

(defprotocol IDisposable
  (-dispose! [this])
  (-disposed? [this]))

(defn dispose! [this] (-dispose! this))

(defn disposed? [this] (-disposed? this))

(defn update! [cursor key f & args]
  (-update! cursor key f args))

                      ))))
              (set! (.-change-key this) nil))
            (cond keyset-watches
                  (let [old-keys (keyset old-state)
                        new-keys (keyset state)
                        [removed added both] (diff-set (set old-keys) (set new-keys))]
                    (when (or (not (empty? removed)) (not (empty? added)))
                      ;; notify key set change
                      )
                    (doseq [rx removed]
                      (.notifyChild rx nil))
                    (doseq [ra added]
                      (.notifyChild ra (get state ra)))
                    (doseq [rc both]
                      (when-let [cursors (get child-cursors rc)]
                        (when-let [cur (first cursors)]
                          (let [old-val (.-state cur)
                                new-val (get state rc)]
                            (when-not (identical? old-val new-val)
                              (doseq [cur cursors]
                                (.updateCursor cur new-val))))))))
                  child-cursors
                  (doseq [[ckey cursors] child-cursors]
                    (let [old-val (get old-state ckey)
                          new-val (get state ckey)]
                      (when-not (identical? old-val new-val)
                        (doseq [cur cursors]
                          (.updateCursor cur new-val)))))))
          (.notifyFWatches this old-state state))))
    (rawDeref [this]
      (when (.-dirty this)
        (.updateCursor this (get-fn)))
      state)
    (reactiveDeref [this]
      (register-dep this id fwatch-binding-info)
      (.rawDeref this))
    (addFWatch [this key f]
      (when-not (aget (.-fwatches this) key)
        (.activate this)
        (set! (.-watchers this) (inc (.-watchers this)))
        (aset (.-fwatches this) key f)))
    (removeFWatch [this key]
      (when (aget (.-fwatches this) key)
        (set! (.-watchers this) (dec (.-watchers this)))
        (js-delete (.-fwatches this) key)
        (when (identical? watchers 0) (.clean this))))
    (notifyFWatches [this oldVal newVal]
      (goog.object/forEach
       (.-fwatches this)
       (fn [f key _]
         (f key this oldVal newVal)))
      (doseq [[key f] (.-watches this)]
        (f key this oldVal newVal))) 

    cljs.core/IAtom

