From fe9d6de78c4d6da6ca3cdeabae99ee855b549588 Mon Sep 17 00:00:00 2001 From: neuroevolutus <19356702+neuroevolutus@users.noreply.github.com> Date: Sun, 5 Mar 2023 16:42:58 -0600 Subject: [PATCH] Explain subtlety with DOM painting --- 1-js/11-async/03-promise-chaining/article.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/1-js/11-async/03-promise-chaining/article.md b/1-js/11-async/03-promise-chaining/article.md index aa60254011..f0b68fd4d2 100644 --- a/1-js/11-async/03-promise-chaining/article.md +++ b/1-js/11-async/03-promise-chaining/article.md @@ -323,6 +323,8 @@ That is, the `.then` handler in line `(*)` now returns `new Promise`, that becom As a good practice, an asynchronous action should always return a promise. That makes it possible to plan actions after it; even if we don't plan to extend the chain now, we may need it later. +As an aside, for readers who are mystified as to why the `img` disappears from the page only after the alert dialog is closed, there's a subtlety with DOM painting that's explained in the article about the JavaScript [event loop](/event-loop). + Finally, we can split the code into reusable functions: ```js run