We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b57405c commit a8dc8e6Copy full SHA for a8dc8e6
packages/reactivity/src/baseWatch.ts
@@ -17,6 +17,8 @@ import {
17
type DebuggerOptions,
18
type EffectScheduler,
19
ReactiveEffect,
20
+ pauseTracking,
21
+ resetTracking,
22
} from './effect'
23
import { isReactive, isShallow } from './reactive'
24
import { type Ref, isRef } from './ref'
@@ -179,7 +181,12 @@ export function baseWatch(
179
181
// no cb -> simple effect
180
182
getter = () => {
183
if (cleanup) {
- cleanup()
184
+ pauseTracking()
185
+ try {
186
+ cleanup()
187
+ } finally {
188
+ resetTracking()
189
+ }
190
}
191
const currentEffect = activeEffect
192
activeEffect = effect
0 commit comments