Files
rose-ash/sx/sxc/reference/ref-event-sse-open-demo.sx
giles a7da235459 SXC content: docs/examples/home/reference pages + SX testing runner
New sxc/ content tree with 120 page files across docs, examples, home,
and reference demos. sx/sx/testing/ adds page-runner.sx (317L) and
index-runner.sx (394L) — SX-native test runner pages for
browser-based evaluation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 09:08:47 +00:00

20 lines
851 B
Plaintext

(defcomp
()
(div
(~tw :tokens "space-y-3")
(div
:sx-sse "/sx/(geography.(hypermedia.(reference.(api.sse-time))))"
:sx-sse-swap "time"
:sx-swap "innerHTML"
:sx-on:sx:sseOpen "document.getElementById('ref-evt-sseopen-status').textContent = 'Connected'; document.getElementById('ref-evt-sseopen-status').className = 'inline-block px-2 py-0.5 rounded text-xs bg-emerald-100 text-emerald-700'"
(div
(~tw :tokens "flex items-center gap-3")
(span
:id "ref-evt-sseopen-status"
(~tw :tokens "inline-block px-2 py-0.5 rounded text-xs bg-amber-100 text-amber-700")
"Connecting...")
(span (~tw :tokens "text-sm text-stone-500") "SSE stream")))
(p
(~tw :tokens "text-xs text-stone-400")
"The status badge turns green when the SSE connection opens.")))