From 7ea02c8ab1e7846430beed508a8fe144cf0978ec Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Thu, 22 Dec 2022 15:35:19 +1000 Subject: [PATCH] update onmount typing to prevent async function return --- src/runtime/internal/lifecycle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts index e75bbdc501..9717509190 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: () => any) { +export function onMount(fn: (() => () => void) | (() => void | Promise)) { get_current_component().$$.on_mount.push(fn); }