feat(reactivity): new effectScope API (#2195)

This commit is contained in:
Anthony Fu
2021-07-07 21:07:19 +08:00
committed by Evan You
parent 87f69fd0bb
commit f5617fc3bb
16 changed files with 400 additions and 89 deletions

View File

@@ -563,7 +563,7 @@ function installCompatMount(
}
delete app._container.__vue_app__
} else {
const { bum, effects, um } = instance
const { bum, scope, um } = instance
// beforeDestroy hooks
if (bum) {
invokeArrayFns(bum)
@@ -572,10 +572,8 @@ function installCompatMount(
instance.emit('hook:beforeDestroy')
}
// stop effects
if (effects) {
for (let i = 0; i < effects.length; i++) {
effects[i].stop()
}
if (scope) {
scope.stop()
}
// unmounted hook
if (um) {