Created
October 5, 2011 22:52
-
-
Save srid/1265979 to your computer and use it in GitHub Desktop.
ClojureScript - prependChild implementation using Google Closure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn ^:export prependChild | |
[parent node] | |
(let [topnode (dom/getFirstElementChild parent)] | |
(if topnode | |
(dom/insertSiblingBefore node topnode) | |
(dom/appendChild parent node)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment