Svelte · Senior · Question 16 of 75
How do you show a loading state with async Svelte?
<svelte:boundary>
<Profile />
{#snippet pending()}
<Spinner />
{/snippet}
</svelte:boundary>- ✓Correct answer: Wrap the content in
<svelte:boundary>with apendingsnippet; for later updates use$effect.pending() - 2Use
{#await}around every component - 3Async Svelte has no loading states
Explanation
The pending snippet is shown only on the first load. Subsequent updates keep the old UI, and $effect.pending() reports how many promises are in flight.