🍡 mochi
← All demos

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.

connecting
<script>
  import CronLog from './CronLog.svelte';
  import { files } from './files.ts';

  const sources = await loadSources(files);
</script>

<CronLog mochi:hydrate />