      (-remove-watch ref key)
      (sully))))
 
+(defn get-add-watch* [ref]
+  (cond
+    (satisfies? IInvalidates ref)
+    add-invalidation-watch
+    (satisfies? IWatchable ref)
+    add-watch))
+
+(defn get-remove-watch* [ref]
+  (cond
+    (satisfies? IInvalidates ref)
+    remove-invalidation-watch
+    (satisfies? IWatchable ref)
+    remove-watch))
+
+(defn get-add-remove-watch* [ref]
+  (cond
+    (satisfies? IInvalidates ref)
+    [add-invalidation-watch remove-invalidation-watch]
+    (satisfies? IWatchable ref)
+    [add-watch remove-watch]))
+
 (deftype ReactiveComputation [^:mutable state ^:mutable dirty f ^:mutable deps meta
                               ^:mutable watches ^:mutable invalidation-watches sully]
   Object

  ([ref getter]
   (lens ref getter (fn [_ _] (assert false "Lens does not support updates"))))
  ([ref getter setter]
   (let [lens (ReactiveLens. ref getter setter nil nil nil)]
     (add-watch ref lens
                (fn [_ _ old-value new-value]
                  (do-update-state lens (getter new-value))))
     (set! (.-state lens) (getter @ref))
     lens)))

(defn cursor [ref korks]

  cljs.core/IDeref
  (-deref [this]
    (register-dep this)
    (if dirty
      (update-lens-state this ref)
      state))

  IMeta
  (-meta [_] meta)
