From 3e54464fdefdd5e6cf3007ad76cb1cbf0de33c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= Date: Tue, 4 Jul 2023 22:30:12 +0800 Subject: [PATCH] chore: there is no need to convert the Set into an array --- packages/reactivity/src/effect.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index d4a34edfef4..81f64285643 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -391,17 +391,15 @@ export function trigger( } export function triggerEffects( - dep: Dep | ReactiveEffect[], + dep: Dep, debuggerEventExtraInfo?: DebuggerEventExtraInfo ) { - // spread into array for stabilization - const effects = isArray(dep) ? dep : [...dep] - for (const effect of effects) { + for (const effect of dep) { if (effect.computed) { triggerEffect(effect, debuggerEventExtraInfo) } } - for (const effect of effects) { + for (const effect of dep) { if (!effect.computed) { triggerEffect(effect, debuggerEventExtraInfo) }