fix(reactivity): effect should still check sync self-trigger

This commit is contained in:
Evan You 2020-08-13 17:45:21 -04:00
parent 611437a3fe
commit ac81dcf0cc

View File

@ -178,7 +178,11 @@ export function trigger(
const effects = new Set<ReactiveEffect>()
const add = (effectsToAdd: Set<ReactiveEffect> | undefined) => {
if (effectsToAdd) {
effectsToAdd.forEach(effect => effects.add(effect))
effectsToAdd.forEach(effect => {
if (effect !== activeEffect) {
effects.add(effect)
}
})
}
}