Skip to content

Instantly share code, notes, and snippets.

@hozumi
Created December 26, 2011 12:17
Show Gist options
  • Save hozumi/1521051 to your computer and use it in GitHub Desktop.
Save hozumi/1521051 to your computer and use it in GitHub Desktop.
[ClojureScript] Wrapping all def into a load event handler
(defn init []
(def main (goog.dom/getElement "main"))
(def mydiv (goog.dom/createDom "div"))
(goog.dom/appendChild main mydiv)
(defn change-color-mydiv []
(... mydiv)))
(goog.events/listen js/window goog.events.EventType/LOAD init)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment