Skip to content

Commit

Permalink
fix(reactivity): effect should still check sync self-trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 13, 2020
1 parent 611437a commit ac81dcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/reactivity/src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
}

Expand Down

0 comments on commit ac81dcf

Please sign in to comment.