-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description

export function trackEffects(dep) {
//看看 dep 之前有没有添加过,添加过的话 那么就不添加了
if (dep.has(activeEffect)) return;
dep.add(activeEffect)
activeEffect.deps.push(dep); // 反向搜集
// start --- test
let count = 0;
if( activeEffect.deps.length ){
testMethod(activeEffect);
}
function testMethod(activeEffect){
const dep = activeEffect.deps[0]
for (const effect of dep) { // debugger
count++;
if(count > 1000){
debugger
console.log('循环结束')
return;
}
testMethod(effect);
}
}
// end -- test
}
Metadata
Metadata
Assignees
Labels
No labels