Skip to content

Commit

Permalink
fix(watch): remove recorded effect on manual stop (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangmingshan authored and yyx990803 committed Jan 8, 2020
1 parent 507b9ed commit 453e688
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/runtime-core/src/apiWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ function doWatch(
recordEffect(runner)
return () => {
stop(runner)
if (instance) {
const effects = instance.effects!
const index = effects.indexOf(runner)
if (index > -1) {
effects.splice(index, 1)
}
}
}
}

Expand Down

0 comments on commit 453e688

Please sign in to comment.