Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jul 31, 2022
1 parent 3533763 commit 6c50d7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ vx:cuixr1314
- [x] 支持最基础的 slots
- [x] 支持 Text 类型节点
- [x] 支持 $el api
- [x] 支持 watchEffect


#### reactivity
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime-core/src/apiWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ function doWatch(source) {
effect.run();
};

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

// 这里是在执行 effect.run 的时候就会调用的
const getter = () => {
source();
};
Expand Down

0 comments on commit 6c50d7f

Please sign in to comment.