Scheduled jobs with cron
A Mochi.cron() job appends one entry to an in-memory log every minute. The browser subscribes over a WebSocket and shows each new row the moment it lands.
<script>
import CronLog from './CronLog.svelte';
</script>
<CronLog mochi:hydrate />
More demos
Client-only Islands How client-only islands work — components marked mochi:clientOnly skip SSR and mount in the browser, with a fallback snippet until then. Tables with TanStack Table How a headless table library works in Mochi — TanStack Table server-rendered to a read-only table with zero JavaScript, then a mochi:hydrate island for interactive sorting. Send Email How sending email works — dispatch through Mochi.email() and read it back in the /_mochi/email dev outbox.