Skip to content

Commit 5c490f1

Browse files
author
Pick
authored
refactor(computed): deprecated computedRunners (#1458)
1 parent f6da6bf commit 5c490f1

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

packages/reactivity/src/computed.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export function computed<T>(
4848
const runner = effect(getter, {
4949
lazy: true,
5050
// mark effect as computed so that it gets priority during trigger
51-
computed: true,
5251
scheduler: () => {
5352
if (!dirty) {
5453
dirty = true

packages/reactivity/src/effect.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,11 @@ export function trigger(
177177
}
178178

179179
const effects = new Set<ReactiveEffect>()
180-
const computedRunners = new Set<ReactiveEffect>()
181180
const add = (effectsToAdd: Set<ReactiveEffect> | undefined) => {
182181
if (effectsToAdd) {
183182
effectsToAdd.forEach(effect => {
184183
if (effect !== activeEffect || !shouldTrack) {
185-
if (effect.options.computed) {
186-
computedRunners.add(effect)
187-
} else {
188-
effects.add(effect)
189-
}
184+
effects.add(effect)
190185
} else {
191186
// the effect mutated its own dependency during its execution.
192187
// this can be caused by operations like foo.value++
@@ -245,8 +240,5 @@ export function trigger(
245240
}
246241
}
247242

248-
// Important: computed effects must be run first so that computed getters
249-
// can be invalidated before any normal effects that depend on them are run.
250-
computedRunners.forEach(run)
251243
effects.forEach(run)
252244
}

0 commit comments

Comments
 (0)