You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/99-ui-misc/03-event-loop/article.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,11 +263,11 @@ What's going to be the order here?
263
263
2.`promise` shows second, because `.then` passes through the microtask queue, and runs after the current code.
264
264
3.`timeout` shows last, because it's a macrotask.
265
265
266
-
The richer event loop picture looks like this (order is from bottom to top, that is: `setTimeout`first, then microtasks and so on):
266
+
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):
267
267
268
268

269
269
270
-
**All microtasks are completed before any other event handling or rendering or any other macrotask takes place.**
270
+
All microtasks are completed before any other event handling or rendering or any other macrotask takes place.
271
271
272
272
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.
0 commit comments