         (on-attached state new-elem))
       new-elem)))
 
-;(defn- do-show-element [parent new-elem nil]
-;  (when new-elem
-;    (let [show (get-transition new-elem :node-attached)
-;          new-elem (replace-or-append-child parent new-elem cur-elem true)]
-;      (when show
-;        (show new-elem)
-;        new-elem)
-;      new-elem)))
-
-(defn- mount-element
-  ([parent new-elem before]
-   (let [show (get-transition new-elem :node-mounted)
-         new-elem (append-or-insert-child parent new-elem before)]
-     (when show
-       (show new-elem)
-       new-elem)
-     new-elem)))
-
-;; (defn- clear-children! [parent]
-;;   (let [dom-node parent
-;;   ;(get-dom-node parent)
-;;         ]
-;;     (loop []
-;;       (let [last-child (.-lastChild dom-node)]
-;;         (when last-child
-;;           (.removeChild dom-node last-child)
-;;           (recur))))))
-
-;; (defn- hide-node [node callback]
-;;   (exec-transition node :node-detaching callback))
-
 ;; Reactive Element Handling
-
-;; (defprotocol INodeContainer
-;;   (-replace [container new-elem-spec]))
 
 (deftype ReactiveElement [id parent ref cur-element dirty updating disposed
                           animate invalidate]

        (.removeAttribute element attr-name)))))

(defn- bind-lifecycle-callback! [node node-state cb-name cb-value]
  (when (identical? cb-name "disposed")
    (set! (.-disposed-callback node-state) cb-value)
    ;; other callbacks automatically included in attr map
    ))

        (show-new-elem (get-new-elem) cur)
        state)
      (do
        (insert-child* (raw-deref* child-ref) before)))))

(defn bind-child [parent child before cur]
  (if-let [binder (:binder (meta child))]
