mirror of https://github.com/vuejs/core.git
fix(watch): remove instance unmounted short circuit in getter of `watchEffect` (#9948)
This commit is contained in:
parent
6de0c55661
commit
f300a4001e
|
|
@ -5,7 +5,6 @@ import {
|
||||||
ReactiveEffect,
|
ReactiveEffect,
|
||||||
ReactiveFlags,
|
ReactiveFlags,
|
||||||
type Ref,
|
type Ref,
|
||||||
getCurrentScope,
|
|
||||||
isReactive,
|
isReactive,
|
||||||
isRef,
|
isRef,
|
||||||
isShallow,
|
isShallow,
|
||||||
|
|
@ -220,8 +219,7 @@ function doWatch(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const instance =
|
const instance = currentInstance
|
||||||
getCurrentScope() === currentInstance?.scope ? currentInstance : null
|
|
||||||
const reactiveGetter = (source: object) =>
|
const reactiveGetter = (source: object) =>
|
||||||
deep === true
|
deep === true
|
||||||
? source // traverse will happen in wrapped getter below
|
? source // traverse will happen in wrapped getter below
|
||||||
|
|
@ -261,9 +259,6 @@ function doWatch(
|
||||||
} else {
|
} else {
|
||||||
// no cb -> simple effect
|
// no cb -> simple effect
|
||||||
getter = () => {
|
getter = () => {
|
||||||
if (instance && instance.isUnmounted) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (cleanup) {
|
if (cleanup) {
|
||||||
cleanup()
|
cleanup()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue