Skip to content

Instantly share code, notes, and snippets.

@sogaiu
Created November 6, 2025 12:41
Show Gist options
  • Select an option

  • Save sogaiu/1d4c32c4f70fe17773a64319b1fde28c to your computer and use it in GitHub Desktop.

Select an option

Save sogaiu/1d4c32c4f70fe17773a64319b1fde28c to your computer and use it in GitHub Desktop.
scittle reagent (from https://babashka.org/scittle/)
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/scittle.js" type="application/javascript"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/scittle.reagent.js" type="application/javascript"></script>
<script type="application/x-scittle">
(require '[reagent.core :as r]
'[reagent.dom :as rdom])
(def state (r/atom {:clicks 0}))
(defn my-component []
[:div
[:p "Clicks: " (:clicks @state)]
[:p [:button {:on-click #(swap! state update :clicks inc)}
"Click me!"]]])
(rdom/render [my-component] (.getElementById js/document "app"))
</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