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) {
113113 // only suspend in async deriveds created on initialisation
114114 var should_suspend = ! active_reaction ;
115115
116- /** @type {Map<Batch, ReturnType<typeof deferred>> } */
116+ /** @type {Map<Batch, ReturnType<typeof deferred<V> >> } */
117117 var deferreds = new Map ( ) ;
118118
119119 async_effect ( ( ) => {
120120 if ( DEV ) current_async_effect = active_effect ;
121121
122+ /** @type {ReturnType<typeof deferred<V>> } */
122123 var d = deferred ( ) ;
123124 promise = d . promise ;
124125
125126 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.
126129 Promise . resolve ( fn ( ) ) . then ( d . resolve , d . reject ) ;
127130 } catch ( error ) {
128131 d . reject ( error ) ;
You can’t perform that action at this time.
0 commit comments