Skip to content

Commit 6c50d7f

Browse files
committed
docs: update docs
1 parent 3533763 commit 6c50d7f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ vx:cuixr1314
5757
- [x] 支持最基础的 slots
5858
- [x] 支持 Text 类型节点
5959
- [x] 支持 $el api
60+
- [x] 支持 watchEffect
6061

6162

6263
#### reactivity

packages/runtime-core/src/apiWatch.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ function doWatch(source) {
1414
effect.run();
1515
};
1616

17+
// 当触发 trigger 的时候会调用 scheduler
1718
// 这里用 scheduler 的目的就是在更新的时候
1819
// 让回调可以在 render 前执行 变成一个异步的行为(这里也可以通过 flush 来改变)
1920
const scheduler = () => queuePreFlushCb(job);
2021

22+
// 这里是在执行 effect.run 的时候就会调用的
2123
const getter = () => {
2224
source();
2325
};

0 commit comments

Comments
 (0)