types: improve type for WatchHandler (#160)

This commit is contained in:
扩散性百万甜面包
2019-10-08 22:48:24 +08:00
committed by Evan You
parent ff0f3bdf7c
commit 016231d09f
2 changed files with 9 additions and 13 deletions

View File

@@ -116,11 +116,11 @@ export type ExtractComputedReturns<T extends any> = {
: ReturnType<T[key]>
}
type WatchHandler = (
val: any,
oldVal: any,
export type WatchHandler<T = any> = (
val: T,
oldVal: T,
onCleanup: CleanupRegistrator
) => void
) => any
type ComponentWatchOptions = Record<
string,