diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts index 9717509190..258f8b651d 100644 --- a/src/runtime/internal/lifecycle.ts +++ b/src/runtime/internal/lifecycle.ts @@ -31,7 +31,7 @@ export function beforeUpdate(fn: () => any) { * * https://svelte.dev/docs#run-time-svelte-onmount */ -export function onMount(fn: (() => () => void) | (() => void | Promise)) { +export function onMount(fn: (() => T extends Promise ? T : T extends Promise ? never : T)): void { get_current_component().$$.on_mount.push(fn); }