 
   IReset
   (-reset! [a newval]
-    (assert (ifn? on-set) "Reaction is read only.")
+    (assert (fn? (.-on-set a)) "Reaction is read only.")
     (let [oldval state]
       (set! state newval)
-      (on-set oldval newval)
+      (.on-set a oldval newval)
       (notify-w a oldval newval)
       newval))
 

      (set! dirty? true)
      (doseq [w wg]
        (remove-watch w this))
      (when-not (nil? on-dispose)
        (on-dispose s)))
    nil)

  IEquiv



(defn make-reaction [f & {:keys [auto-run on-set on-dispose]}]
  (let [reaction (Reaction. f nil true false nil nil nil)]
    (._set-opts reaction {:auto-run auto-run
                          :on-set on-set
                          :on-dispose on-dispose})
