       (dispose! this)))
 
   IReset
-  (-reset! [a new-value]
-    (let [old-value state]
-      (set! state new-value)
-      (-notify-watches a old-value new-value)
-      new-value))
+  (-reset! [a newval]
+    (let [oldval state]
+      (set! state newval)
+      (when on-set
+        (set! dirty? true)
+        (on-set oldval newval))
+      (-notify-watches a oldval newval)
+      newval))
 
   ISwap
   (-swap! [a f]


  IWatchable
  (-notify-watches [this oldval newval]
    (when on-set
      (on-set oldval newval))
    (call-watches this watches oldval newval))

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

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

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