MCPcopy Create free account
hub / github.com/ygs-code/vue / flushCallbacks

Function flushCallbacks

vue.js:2615–2627  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2613 var pending = false;
2614 // 触发 callbacks 队列中的函数
2615 function flushCallbacks() {
2616
2617 pending = false;
2618 //.slice(0) 浅拷贝
2619 var copies = callbacks.slice(0);
2620 callbacks.length = 0;
2621 console.log(copies)
2622
2623 for (var i = 0; i < copies.length; i++) {
2624 //执行回调函数
2625 copies[i]();
2626 }
2627 }
2628
2629 // Here we have async deferring wrappers using both microtasks and (macro) tasks. 在这里,我们使用了微任务和宏任务的异步包装器。
2630 // In < 2.4 we used microtasks everywhere, but there are some scenarios where 在< 2.4中,我们到处使用微任务,但也有一些场景。

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected