Created
October 15, 2017 07:34
-
-
Save JeOam/c84f0b421ddf731498ec55fb040b4078 to your computer and use it in GitHub Desktop.
Revisions
-
JeOam revised this gist
Oct 15, 2017 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ 一个事件循环(EventLoop)中会有一个正在执行的任务(Task),而这个任务就是从 macrotask 队列中来的。在[whatwg](https://html.spec.whatwg.org/multipage/webappapis.html#task-queue)规范中有 queue 就是任务队列。当这个 macrotask 执行结束后所有可用的 microtask 将会在同一个事件循环中执行,当这些 microtask 执行结束后还能继续添加 microtask 一直到真个 microtask 队列执行结束。 * **macrotasks**: `setTimeout` `setInterval` `setImmediate` I/O UI渲染 * **microtasks**: `Promise` `process.nextTick` `Object.observe` `MutationObserver` via [click](https://github.com/ccforward/cc/issues/48) -
JeOam created this gist
Oct 15, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ 一个事件循环(EventLoop)中会有一个正在执行的任务(Task),而这个任务就是从 macrotask 队列中来的。在[whatwg](https://html.spec.whatwg.org/multipage/webappapis.html#task-queue)规范中有 queue 就是任务队列。当这个 macrotask 执行结束后所有可用的 microtask 将会在同一个事件循环中执行,当这些 microtask 执行结束后还能继续添加 microtask 一直到真个 microtask 队列执行结束。 * **macrotasks**: setTimeout setInterval setImmediate I/O UI渲染 * **microtasks**: Promise process.nextTick Object.observe MutationObserver