Skip to content

Commit 482e669

Browse files
committed
fix(apiWatch): handle implicitly any type in watch callback
1 parent 21f3c75 commit 482e669

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/dts-test/watch.test-d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ watch(readonlyArr, (values, oldValues) => {
5757
expectType<Readonly<[string, string, number]>>(oldValues)
5858
})
5959

60+
// no type error, case from vueuse
61+
declare const aAny: any
62+
watch(aAny, (v, ov) => {})
63+
watch(aAny, (v, ov) => {}, { immediate: true })
64+
6065
// immediate watcher's oldValue will be undefined on first run.
6166
watch(
6267
source,

0 commit comments

Comments
 (0)