How do Promises Work? - Quil’s Fluffy World
- Japanese translation: How Promise works - Implementing Promise | POSTD Good commentary, but the Japanese translation is not very good.
For Promise - JavaScript | MDN on 6/2019
-
The term “resolve is called asynchronously” is ambiguous. I wrote, but now that I look at it, I couldn’t find that expression. As of 2021/2, it is written more clearly.
-
Note that promises are guaranteed to be asynchronous. Thus, an action on a promise that has already been “resolved” will be executed only after the stack has been cleared and a clock tick has elapsed. This effect is very similar to setTimeout(action,10) ---old The term “resolve is called asynchronously” is ambiguous.
- The first argument of Promise, (resolve, reject) ⇒ {…} Whether you call resolve synchronously or asynchronously in
:
create promise start
promise body start
sync body start
sync body end
promise body end
create promise end
specify promise.then start
specify promise.then end
resolved ok
ts
This page is auto-translated from /nishio/Promise using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.