Skip to content

Commit

Permalink
fix(apiWatch): handle implicitly any type in watch callback
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-leong committed May 31, 2024
1 parent 21f3c75 commit 482e669
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/dts-test/watch.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ watch(readonlyArr, (values, oldValues) => {
expectType<Readonly<[string, string, number]>>(oldValues)
})

// no type error, case from vueuse
declare const aAny: any
watch(aAny, (v, ov) => {})
watch(aAny, (v, ov) => {}, { immediate: true })

// immediate watcher's oldValue will be undefined on first run.
watch(
source,
Expand Down

0 comments on commit 482e669

Please sign in to comment.