   [container el]
   (let [el (if (dom-element? el)
              el
-             (build-dom-elem el))]
+             (singult/render el))]
     (gdom/insertChildAt (select container) el 0)
     el))
 

  (.-parentNode (select node)))



(declare build-dom-elem)
(declare canonicalize)


(defn append!
  "Make element last child of container.
   Returns live DOM node.

  [old new]
  (let [new (condp = (node-type new)
              :dom new
              :hiccup (singult/render new)
              :selector (select new))]
    (gdom/replaceNode new (select old))))

