 (defn remove-invalidation-watch [this key]
   (-remove-invalidation-watch this key))
 
-(deftype ReactiveAtom [state meta validator watches]
+(deftype ReactiveAtom [state meta validator watches swatches]
   Object
   (equiv [this other]
     (-equiv this other))
+  (addSwatch [this key f]
+    (aset (.-swatches this) key f))
+  (removeSwatch [this key]
+    (js-delete (.-swatches this) key))
+  (notifySwatches [this oldVal newVal]
+    ;(doseq [[key f] invalidation-watches]
+    ;  (f key this))
+    (goog.object/forEach
+      (.-swatches this)
+      (fn [f key _]
+        (f key this oldVal newVal)))
+    (doseq [[key f] watches]
+      (f key this oldVal newVal)))
 
   cljs.core/IAtom
 

             (if-not (empty? (.-watches reactive))
               ;; updates state and notifies watches
               (when (-compute reactive)
                 (-notify-invalidation-watches reactive))
               ;; updates only invalidation watches
               (-notify-invalidation-watches reactive))))
          ([key ref]
           (-remove-invalidation-watch ref key)
           (sully))
          ([key ref _ _]
           (-remove-watch ref key)

  Object
  (equiv [this other]
    (-equiv this other))
  (notifyInvalidationWatches [this]
    ;(doseq [[key f] invalidation-watches]
    ;  (f key this))
    (goog.object/forEach
      invalidation-watches
      (fn [f key _]
        (f key this))))
  (addInvalidationWatch [this key f]
    (aset invalidation-watches key f)
    ;(set! (.-invalidation-watches this) (assoc invalidation-watches key f))
    this)
  (removeInvalidationWatch [this key]
    ;(set! (.-invalidation-watches this) (dissoc invalidation-watches key))
    (js-delete invalidation-watches key)
    this)

  IReactive
  (-raw-deref [this]
