Skip to content

Commit 4669047

Browse files
authored
only allow passing functions to lifecycle functions (#5529)
1 parent 0ec9283 commit 4669047

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/runtime/internal/lifecycle.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ export function get_current_component() {
1111
return current_component;
1212
}
1313

14-
export function beforeUpdate(fn) {
14+
export function beforeUpdate(fn: () => any) {
1515
get_current_component().$$.before_update.push(fn);
1616
}
1717

18-
export function onMount(fn) {
18+
export function onMount(fn: () => any) {
1919
get_current_component().$$.on_mount.push(fn);
2020
}
2121

22-
export function afterUpdate(fn) {
22+
export function afterUpdate(fn: () => any) {
2323
get_current_component().$$.after_update.push(fn);
2424
}
2525

26-
export function onDestroy(fn) {
26+
export function onDestroy(fn: () => any) {
2727
get_current_component().$$.on_destroy.push(fn);
2828
}
2929

0 commit comments

Comments
 (0)