File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ declare namespace $derived {
234234 * https://svelte.dev/docs/svelte/$effect
235235 * @param fn The function to execute
236236 */
237- declare function $effect ( fn : ( signal : AbortSignal ) => void | ( ( signal : AbortSignal ) => void ) ) : void ;
237+ declare function $effect ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
238238
239239declare namespace $effect {
240240 /**
@@ -253,7 +253,7 @@ declare namespace $effect {
253253 * https://svelte.dev/docs/svelte/$effect#$effect.pre
254254 * @param fn The function to execute
255255 */
256- export function pre ( fn : ( signal : AbortSignal ) => void | ( ( signal : AbortSignal ) => void ) ) : void ;
256+ export function pre ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
257257
258258 /**
259259 * The `$effect.tracking` rune is an advanced feature that tells you whether or not the code is running inside a tracking context, such as an effect or inside your template.
Original file line number Diff line number Diff line change @@ -403,12 +403,13 @@ export function update_reaction(reaction) {
403403
404404 if ( ( flags & EFFECT ) !== 0 && /** @type {Function } */ ( reaction . fn ) . length > 0 ) {
405405 var controller = new AbortController ( ) ;
406- var inner = /** @type {Function } */ ( 0 , reaction . fn ) ( controller . signal ) ;
406+ var signal = controller . signal ;
407+ var inner = /** @type {Function } */ ( 0 , reaction . fn ) ( { signal } ) ;
407408
408409 result = ( ) => {
409410 controller . abort ( 'effect destroyed' ) ;
410411 inner ?. ( ) ;
411- }
412+ } ;
412413 } else {
413414 result = /** @type {Function } */ ( 0 , reaction . fn ) ( ) ;
414415 }
Original file line number Diff line number Diff line change @@ -2892,7 +2892,7 @@ declare namespace $derived {
28922892 * https://svelte.dev/docs/svelte/$effect
28932893 * @param fn The function to execute
28942894 */
2895- declare function $effect ( fn : ( signal : AbortSignal ) => void | ( ( signal : AbortSignal ) => void ) ) : void ;
2895+ declare function $effect ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
28962896
28972897declare namespace $effect {
28982898 /**
@@ -2911,7 +2911,7 @@ declare namespace $effect {
29112911 * https://svelte.dev/docs/svelte/$effect#$effect.pre
29122912 * @param fn The function to execute
29132913 */
2914- export function pre ( fn : ( signal : AbortSignal ) => void | ( ( signal : AbortSignal ) => void ) ) : void ;
2914+ export function pre ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
29152915
29162916 /**
29172917 * The `$effect.tracking` rune is an advanced feature that tells you whether or not the code is running inside a tracking context, such as an effect or inside your template.
You can’t perform that action at this time.
0 commit comments