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 ddba601 commit b248eecCopy full SHA for b248eec
packages/runtime-core/src/apiWatch.ts
@@ -378,13 +378,6 @@ function doWatch(
378
379
const effect = new ReactiveEffect(getter, scheduler)
380
381
- const unwatch = () => {
382
- effect.stop()
383
- if (instance && instance.scope) {
384
- remove(instance.scope.effects!, effect)
385
- }
386
387
-
388
if (__DEV__) {
389
effect.onTrack = onTrack
390
effect.onTrigger = onTrigger
@@ -406,6 +399,13 @@ function doWatch(
406
399
effect.run()
407
400
}
408
401
402
+ const unwatch = () => {
403
+ effect.stop()
404
+ if (instance && instance.scope) {
405
+ remove(instance.scope.effects!, effect)
+ }
+
409
if (__SSR__ && ssrCleanup) ssrCleanup.push(unwatch)
410
return unwatch
411
0 commit comments