## Demo: lazy-server-island ### LazyServerIsland.svelte ```svelte

Scroll down to trigger each fetch. The IntersectionObserver fires per-island.

Island #1 — rootMargin: '200px'

Loading server island
{#each [2, 3, 4, 5] as i (i)}

Island #{i}

Loading server island
{/each}
``` ### LazyServerDemo.svelte ```svelte
#{index} Fetched at {renderedAt}
``` ### routes.ts ```ts import { Mochi } from 'mochi-framework'; import type { MochiRouteValue } from 'mochi-framework'; export const routes: Record = { '/demos/lazy-server-island': Mochi.page('./src/demos/lazy-server-island/LazyServerIsland.svelte'), }; ``` ### index.ts ```ts import { Mochi, logger } from 'mochi-framework'; import { routes } from './routes'; await Mochi.serve({ port: 3333, development: process.env.MODE === 'development', routes, }); logger.info('Server running at http://localhost:3333'); ```