Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4.7k
Open
Description
Describe the bug
Sometimes $effect.pending() doesn't work, I don't know the exact conditions but check out the repro below for an example.
Reproduction
<script>let value=$state(0);asyncfunctiondelayed(v) {awaitnewPromise(r=>setTimeout(r,1000));return v;}let slowSquare=$derived(awaitdelayed(value**2));</script><buttononclick={()=>value++}>Increment</button>{#if$effect.pending()}<p>Performing intensive mathematical calculations...</p>{:elseifvalue>=-1}<p>{value} ^ 2 = {slowSquare}</p>{/if}
Logs
System Info
svelte playground
Severity
blocking an upgrade
Metadata
Metadata
Assignees
Labels
No labels