 
 (declare get-transition)
 
+(defn- init-element-meta! [state element-spec]
+  (let [m (meta element-spec)]
+    (set! (.-meta state) m)
+    (when-let [on-disposed (get m :node-disposed)]
+      (set! (.-disposed-callback state) on-disposed))))
+
+(defn- reset-element-spec! [state spec]
+  (when-let [on-disposed (.-disposed-callback state)]
+    (on-disposed)
+    (set! (.-disposed-callback state) nil))
+  (set! (.-element-spec state) spec)
+  (init-element-meta! state spec))
+
 (defn- init-element-state! [dom-node element-spec]
   (let [node-id (str auto-node-id)
         state (ElementState. node-id false element-spec nil)]
     (set! auto-node-id (inc auto-node-id))
     (set-attr! dom-node "data-freactive-id" node-id)
-    (when-let [m (meta element-spec)]
-      (when-let [on-disposed (get m :node-disposed)]
-        (set! (.-disposed-callback state) on-disposed)))
+    (init-element-meta! state element-spec)
     (aset element-state-lookup node-id state)
     ;;(set! element-state-lookup (assoc element-state-lookup dom-node state))
     state))

          (bind-attr! node k v state))
        (when children
          (append-children! node children))
        (when-let [m (meta virtual-dom)]
          (when-let [node-created (get m :node-created)]
            (node-created node)))
        node))))

(defn mount! [element child]

                (let [next-sib (.-nextSibling cur-child)]
                  (remove-dom-node cur-child)
                  (recur next-sib)))))
          ()
          cur-dom-node))
      (do
        ;(println "build hit" (first vdom) (first cur-vdom))
