File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -113,16 +113,19 @@ export function async_derived(fn, location) {
113
113
// only suspend in async deriveds created on initialisation
114
114
var should_suspend = ! active_reaction ;
115
115
116
- /** @type {Map<Batch, ReturnType<typeof deferred>> } */
116
+ /** @type {Map<Batch, ReturnType<typeof deferred<V> >> } */
117
117
var deferreds = new Map ( ) ;
118
118
119
119
async_effect ( ( ) => {
120
120
if ( DEV ) current_async_effect = active_effect ;
121
121
122
+ /** @type {ReturnType<typeof deferred<V>> } */
122
123
var d = deferred ( ) ;
123
124
promise = d . promise ;
124
125
125
126
try {
127
+ // If this code is changed at some point, make sure to still access the then property
128
+ // of fn() to read any signals it might access, so that we track them as dependencies.
126
129
Promise . resolve ( fn ( ) ) . then ( d . resolve , d . reject ) ;
127
130
} catch ( error ) {
128
131
d . reject ( error ) ;
You can’t perform that action at this time.
0 commit comments