Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created November 16, 2025 12:45
Show Gist options
  • Select an option

  • Save borkdude/4432b2f437a65ab8d1b364eef4ce3c8b to your computer and use it in GitHub Desktop.

Select an option

Save borkdude/4432b2f437a65ab8d1b364eef4ce3c8b to your computer and use it in GitHub Desktop.
reagami in scittle
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/scittle.js" type="application/javascript"></script>
<script type="application/x-scittle">
(defn js-in "Patch for `js-in` missing in scittle"
[k v]
(js/Object.hasOwn v k))
(intern 'clojure.core 'js-in js-in)
</script>
<script type="application/x-scittle" src="https://raw.githubusercontent.com/borkdude/reagami/refs/heads/main/src/reagami/core.cljc"></script>
</head>
<body>
<div id="app"></div>
<script type="application/x-scittle">
(ns app (:require [reagami.core :as reagami]))
(def state (atom {:counter 0}))
(defn render []
(reagami/render js/app [:div [:span "Hello, you clicked " (:counter @state) " times!"]
[:div [:button {:on-click #(swap! state update :counter inc)}
"Click!"]]]))
(render)
(add-watch state ::render render)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment