add broadcast ui example

This commit is contained in:
Adam Jeniski 2025-07-21 08:44:33 -09:00
parent 7af519c788
commit 32fcf7a6e9

View File

@ -16,6 +16,9 @@
(u/patch-signals-edn! sse {:msg (subs message 0 (inc i))})
(Thread/sleep 500)))
(defaction say-hi [sse_]
(u/broadcast-signals! {:msg "hello from the great beyond!"}))
;; pages
(defpage home-page
(html->str
@ -31,7 +34,12 @@
(defpage page-2
(html->str
[:main
[:div
[:p "this is page2"]
[:button
{:data-on-click (->expr (@post ~say-hi))}
"say hi to everyone"]]
[:button {:data-on-click (->expr (@post ~home-page))}
"go back to home"]]))