diff --git a/src/main/example/core.clj b/src/main/example/core.clj index 19050bd..6854d91 100644 --- a/src/main/example/core.clj +++ b/src/main/example/core.clj @@ -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"]]))