update onmount typing to prevent async function return

pull/8136/head
Chris Kerr 4 years ago
parent 6a23d9b65f
commit 7ea02c8ab1

@ -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<void>)) {
get_current_component().$$.on_mount.push(fn);
}

Loading…
Cancel
Save