Update src/runtime/internal/lifecycle.ts

pull/8136/head
Simon H 3 years ago committed by GitHub
parent 5c150827e1
commit 1246260fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,7 +33,7 @@ export function beforeUpdate(fn: () => any) {
*
* https://svelte.dev/docs#run-time-svelte-onmount
*/
export function onMount<T>(fn: () => T extends Promise<() => any> ? never : T): void {
export function onMount<T>(fn: () => T extends Promise<() => any> ? "Returning a function asynchronously from onMount won't call that function on destroy" : T): void {
get_current_component().$$.on_mount.push(fn);
}

Loading…
Cancel
Save