Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2011 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1163881 to your computer and use it in GitHub Desktop.
Save anonymous/1163881 to your computer and use it in GitHub Desktop.
(defn ^:export main []
(let [timer (goog.Timer. 1000)
x (atom 1)]
(. timer (start))
(goog.events/listen timer goog.Timer/TICK
#(let [box (.getElement goog.dom (str "box" @x))]
(.setTextContent goog.dom box (str "hello box " @x))
(swap! x inc)
(if (= x 6)
(. timer (stop)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment