menu_book Course Curriculum (Svelte 5) expand_more
Component Syntax
Runes & Reactivity
Composition
Motion & Lifecycle
SvelteKit Routing
Await blocks
Learn Await blocks in Svelte 5 with a dedicated explanation, a concept-specific example, a production caution, and a mastery check.
12 min read
•
Beginner
svelte-5-005.svelte
svelte
<script>let report=fetch("/api/report").then(r=>r.json());</script>
{#await report}<p>Loading…</p>{:then data}<pre>{JSON.stringify(data)}</pre>{:catch error}<p>{error.message}</p>{/await}
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content