         (set! active? true))
       (set! dirty? false)
       (set! state res)
-      (call-watches this watches oldstate state)
+      (-notify-watches this oldstate state)
       res))
 
   IDeref

(defprotocol IComputedImpl
  (-update-watching [this derefed])
  (-handle-change [k sender oldval newval]))

(defn- call-watches [obs watches oldval newval]
  (reduce-kv (fn [_ key f]
               (f key obs oldval newval)
               nil)
             nil watches))

(deftype Reaction [f ^:mutable state ^:mutable dirty? ^:mutable active?
                   ^:mutable watching ^:mutable watches


  IWatchable
  (-notify-watches [this oldval newval]
    (reduce-kv (fn [_ key f]
                 (f key this oldval newval)
                 nil)
               nil watches))

  (-add-watch [this k wf]
    (set! watches (assoc watches k wf)))
