Skip to content

Instantly share code, notes, and snippets.

@borkdude
Last active October 3, 2025 21:15
Show Gist options
  • Save borkdude/795ba9a7785a0f95d2be25ba47acf9b4 to your computer and use it in GitHub Desktop.
Save borkdude/795ba9a7785a0f95d2be25ba47acf9b4 to your computer and use it in GitHub Desktop.
my_hoplon_demo.cljs
(ns test1
(:require
[hoplon.core :as h]
[javelin.core :as j]))
(h/defelem timer [attrs children]
(let [start (or (:start attrs) 0)
seconds (j/cell start)]
(.setInterval js/window #(swap! seconds inc) 1000)
(h/div attrs (j/cell= (str "Seconds Elapsed: " seconds)))))
(.replaceChildren (.getElementById js/document "app")
(timer))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment