     (aset (.-style elem) prop-name (normalize-attr-value prop-value))
     (js-delete (.-style elem) prop-name))
   prop-value)
+
+(deftype ReactiveAttribute [id the-ref binding-info set-fn ^:mutable disposed]
+  Object
+  (dispose [this]
+    ((.-remove-watch binding-info) ref id)
+    (when-let [clean (.-clean binding-info)] (clean the-ref))
+    (when-let [binding-disposed (get (meta the-ref) :binding-disposed)]
+      (binding-disposed)))
+  (invalidate [this]
+    ((.-remove-watch binding-info) ref id)
+    (queue-animation
+     (fn [_]
+       (when-not disposed 
+         ((.-add-watch binding-info) ref id #(.invalidate this))
+         (set-fn ((.-raw-deref binding-info) ref)))))))
 
 (defn- bind-attr* [set-fn element state-key ref node-state]
   (let [binding-fns (r/get-binding-fns ref)


;; (defn bind-keys [keyset-cursor element-fn]
;;   )

(defn- init-element-state! [dom-node tag]
  (let [node-id (str auto-node-id)
        state ;;(ElementState. node-id false element-spec nil)
        #js {:id node-id :disposed false :tag tag}]
    (set! auto-node-id (inc auto-node-id))
    (set! (.-freactive-state dom-node) state)
    state))
