Skip to content

Vue3.0 源码阅读

reactive

effectStack

let vr = VueReactivity;
let counter = vr.reactive({ num: 0 });
let counter1 = vr.reactive({ num: 0 });
const numSpy = () => {
counter.num = counter1.num + 1;
};
const numSpy1 = () => {
counter1.num = counter.num + 1;
};
vr.effect(numSpy);
vr.effect(numSpy1);

去掉 effectStack

这个例子就会 loops