Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created August 1, 2026 18:06
Show Gist options
  • Select an option

  • Save borkdude/9e8e16f557cc5b5def881a48c2b72cd2 to your computer and use it in GitHub Desktop.

Select an option

Save borkdude/9e8e16f557cc5b5def881a48c2b72cd2 to your computer and use it in GitHub Desktop.
Reagami in Scittle
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/scittle@0.8.32/dist/scittle.js" type="application/javascript"></script>
<script src="https://raw.githubusercontent.com/borkdude/reagami/refs/heads/main/src/reagami/core.cljc" type="application/x-scittle"></script>
<script type="application/x-scittle">
(ns my-app (:require [reagami.core :as reagami]))
(defonce !state (atom {:counter 0}))
(defn render []
(reagami/render js/app
[:div
[:div"Clicks: " (:counter @!state)]
[:div
[:button {:on-click #(swap! !state update :counter inc)}
"Click me"]]]))
(render)
(add-watch !state ::render (fn [_ _ _ _] (render)))
</script>
</head>
<body>
<div id="app">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment