 ;;; Queueing
 
 (defonce rea-queue nil)
-
-(def ^boolean ^:dynamic *flushing*)
+(def empty-context #js{})
 
 (defn- rea-enqueue [r]
   (when (nil? rea-queue)


  IDeref
  (-deref [this]
    (when-not (or *flushing* (not (nil? *ratom-context*)))
      (flush!))
    (if-not (and (nil? auto-run) (nil? *ratom-context*))
      (do

(defn flush! []
  (when-some [q rea-queue]
    (set! rea-queue nil)
    (binding [*ratom-context* empty-context]
      (run-queue q))
    (assert (nil? (-captured empty-context)))))


;;; Atom
