|
@@ -273,10 +273,11 @@ function doWatch(
|
|
|
getter = () => traverse(baseGetter())
|
|
getter = () => traverse(baseGetter())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let cleanup: () => void
|
|
|
|
|
|
|
+ let cleanup: (() => void) | undefined
|
|
|
let onCleanup: OnCleanup = (fn: () => void) => {
|
|
let onCleanup: OnCleanup = (fn: () => void) => {
|
|
|
cleanup = effect.onStop = () => {
|
|
cleanup = effect.onStop = () => {
|
|
|
callWithErrorHandling(fn, instance, ErrorCodes.WATCH_CLEANUP)
|
|
callWithErrorHandling(fn, instance, ErrorCodes.WATCH_CLEANUP)
|
|
|
|
|
+ cleanup = effect.onStop = undefined
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|