Skip to content

Commit

Permalink
fix(watch): remove instance unmounted short circuit in getter of `wat…
Browse files Browse the repository at this point in the history
…chEffect`
  • Loading branch information
yangmingshan committed Dec 30, 2023
1 parent 8f85b6d commit 29f9880
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/runtime-core/src/apiWatch.ts
Expand Up @@ -5,7 +5,6 @@ import {
ReactiveEffect,
ReactiveFlags,
type Ref,
getCurrentScope,
isReactive,
isRef,
isShallow,
Expand Down Expand Up @@ -220,9 +219,7 @@ function doWatch(
)
}

const instance =
getCurrentScope() === currentInstance?.scope ? currentInstance : null
// const instance = currentInstance
const instance = currentInstance
let getter: () => any
let forceTrigger = false
let isMultiSource = false
Expand Down Expand Up @@ -259,9 +256,6 @@ function doWatch(
} else {
// no cb -> simple effect
getter = () => {
if (instance && instance.isUnmounted) {
return
}
if (cleanup) {
cleanup()
}
Expand Down

0 comments on commit 29f9880

Please sign in to comment.