Describe the bug
I don't know if it's a bug or intentional, but the $effect.pending() rune is affected by promises created via fork(), even if it hasn't been committed.
This causes issues when using $effect.pending() to display a loading state.
I think $effect.pending() should not be affected by fork(), just like $state.eager().
Reproduction
https://svelte.dev/playground/cbfae12100cb456a8d466eb979e91957?version=5.56.9
-
Click "increment" to start loading the data asynchronously.
The UI is correctly updated to a loading state, thanks to $effect.pending(), and the DOM is updated when the promise resolve.
-
Click "fork" to start loading the data asynchronously without updating the DOM, using fork().
The DOM will not be updated until the fork is committed, except for $effect.pending() which will put the UI into an unwanted loading state.
Logs
System Info
Severity
annoyance
Describe the bug
I don't know if it's a bug or intentional, but the
$effect.pending()rune is affected by promises created viafork(), even if it hasn't been committed.This causes issues when using
$effect.pending()to display a loading state.I think
$effect.pending()should not be affected byfork(), just like$state.eager().Reproduction
https://svelte.dev/playground/cbfae12100cb456a8d466eb979e91957?version=5.56.9
Click "increment" to start loading the data asynchronously.
The UI is correctly updated to a loading state, thanks to
$effect.pending(), and the DOM is updated when the promise resolve.Click "fork" to start loading the data asynchronously without updating the DOM, using
fork().The DOM will not be updated until the fork is committed, except for
$effect.pending()which will put the UI into an unwanted loading state.Logs
System Info
Severity
annoyance