🍡 mochi
← All demos

Real-time Streams

A WebSocket clock and a Server-Sent Events clock side by side. The component hydrates lazily — JS and CSS load only when it scrolls into view.

WebSocket connecting
--:--:-- /ws/time
SSE connecting
--:--:-- /sse/time
island-id: mochi-y1cpPP3t-0
<script>
  import RealtimeClocks from './RealtimeClocks.svelte';
</script>

<RealtimeClocks mochi:hydrate:visible={{ rootMargin: '100px' }} />