fix(watch): remove recorded effect on manual stop (#590)

This commit is contained in:
Yang Mingshan 2020-01-09 01:06:16 +08:00 committed by Evan You
parent 507b9ed3b3
commit 453e6889da

View File

@ -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)
}
}
}
}