Created
August 1, 2026 18:06
-
-
Save borkdude/9e8e16f557cc5b5def881a48c2b72cd2 to your computer and use it in GitHub Desktop.
Reagami in Scittle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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