Skip to content

Commit

Permalink
fixes #1747
Browse files Browse the repository at this point in the history
  • Loading branch information
iliakan committed Feb 14, 2020
1 parent c6c25c9 commit 9acc130
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 2-ui/99-ui-misc/03-event-loop/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ What's going to be the order here?
2. `promise` shows second, because `.then` passes through the microtask queue, and runs after the current code.
3. `timeout` shows last, because it's a macrotask.

The richer event loop picture looks like this (order is from bottom to top, that is: `setTimeout` first, then microtasks and so on):
The richer event loop picture looks like this (order is from top to bottom, that is: the script first, then microtasks, rendering and so on):

![](eventLoop-full.svg)

**All microtasks are completed before any other event handling or rendering or any other macrotask takes place.**
All microtasks are completed before any other event handling or rendering or any other macrotask takes place.

That's important, as it guarantees that the application environment is basically the same (no mouse coordinate changes, no new network data, etc) between microtasks.

Expand Down
2 changes: 1 addition & 1 deletion 2-ui/99-ui-misc/03-event-loop/eventLoop-full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures.sketch
Binary file not shown.

0 comments on commit 9acc130

Please sign in to comment.