You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在 triggerEffects 函数中,对 dep 的判断多余,将 dep:Set 展开到一个数组的操作多余。
下图是所有用到 triggerEffects 函数的地方:
dep 参数不可能是Array,而且dep是Set对象,可以直接for of 遍历。
exportfunctiontriggerEffects(dep: Dep|ReactiveEffect[],debuggerEventExtraInfo?: DebuggerEventExtraInfo){// spread into array for stabilizationconsteffects=isArray(dep) ? dep : [...dep]for(consteffectofeffects){if(effect.computed){triggerEffect(effect,debuggerEventExtraInfo)}}for(consteffectofeffects){if(!effect.computed){triggerEffect(effect,debuggerEventExtraInfo)}}}
What problem does this feature solve?
在
triggerEffects
函数中,对dep
的判断多余,将dep:Set
展开到一个数组的操作多余。下图是所有用到
triggerEffects
函数的地方:dep
参数不可能是Array
,而且dep
是Set
对象,可以直接for of
遍历。What does the proposed API look like?
The text was updated successfully, but these errors were encountered: