File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : minor
3+ ---
4+
5+ feat: pass AbortSignal to effects and allow async signature
Original file line number Diff line number Diff line change @@ -234,7 +234,9 @@ declare namespace $derived {
234234 * https://svelte.dev/docs/svelte/$effect
235235 * @param fn The function to execute
236236 */
237- declare function $effect ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
237+ declare function $effect (
238+ fn : ( input : { signal : AbortSignal } ) => void | ( ( ) => void ) | Promise < void >
239+ ) : void ;
238240
239241declare namespace $effect {
240242 /**
@@ -253,7 +255,9 @@ declare namespace $effect {
253255 * https://svelte.dev/docs/svelte/$effect#$effect.pre
254256 * @param fn The function to execute
255257 */
256- export function pre ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
258+ export function pre (
259+ fn : ( input : { signal : AbortSignal } ) => void | ( ( ) => void ) | Promise < void >
260+ ) : void ;
257261
258262 /**
259263 * 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 @@ -2892,7 +2892,9 @@ declare namespace $derived {
28922892 * https://svelte.dev/docs/svelte/$effect
28932893 * @param fn The function to execute
28942894 */
2895- declare function $effect ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
2895+ declare function $effect (
2896+ fn : ( input : { signal : AbortSignal } ) => void | ( ( ) => void ) | Promise < void >
2897+ ) : void ;
28962898
28972899declare namespace $effect {
28982900 /**
@@ -2911,7 +2913,9 @@ declare namespace $effect {
29112913 * https://svelte.dev/docs/svelte/$effect#$effect.pre
29122914 * @param fn The function to execute
29132915 */
2914- export function pre ( fn : ( input : { signal : AbortSignal } ) => void | ( ( input : { signal : AbortSignal } ) => void ) ) : void ;
2916+ export function pre (
2917+ fn : ( input : { signal : AbortSignal } ) => void | ( ( ) => void ) | Promise < void >
2918+ ) : void ;
29152919
29162920 /**
29172921 * 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