diff --git a/packages/reactivity/src/computed.ts b/packages/reactivity/src/computed.ts index d6f89fe284e..611ecaefb56 100644 --- a/packages/reactivity/src/computed.ts +++ b/packages/reactivity/src/computed.ts @@ -48,7 +48,6 @@ export function computed( const runner = effect(getter, { lazy: true, // mark effect as computed so that it gets priority during trigger - computed: true, scheduler: () => { if (!dirty) { dirty = true diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index c6187d296ee..98aff15ddbd 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -177,16 +177,11 @@ export function trigger( } const effects = new Set() - const computedRunners = new Set() const add = (effectsToAdd: Set | undefined) => { if (effectsToAdd) { effectsToAdd.forEach(effect => { if (effect !== activeEffect || !shouldTrack) { - if (effect.options.computed) { - computedRunners.add(effect) - } else { - effects.add(effect) - } + effects.add(effect) } else { // the effect mutated its own dependency during its execution. // this can be caused by operations like foo.value++ @@ -245,8 +240,5 @@ export function trigger( } } - // Important: computed effects must be run first so that computed getters - // can be invalidated before any normal effects that depend on them are run. - computedRunners.forEach(run) effects.forEach(run) }