 
 
 (deftype Reaction [f ^:mutable state ^:mutable ^boolean dirty? ^boolean nocache?
-                   ^:mutable watching ^:mutable watches ^:mutable auto-run]
+                   ^:mutable watching ^:mutable watches ^:mutable auto-run
+                   ^:mutable caught]
   IAtom
   IReactiveAtom
 



(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})


  IDeref
  (-deref [this]
    (when-some [e caught]
      (set! caught nil)
      (throw e))
    (let [non-reactive (nil? *ratom-context*)]
      (when non-reactive
        (flush!))
