I'm working on a small NodeJS project, and I honestly do not understand Promises and await. Why design async things, then constantly wait on them? What am I missing?
-
-
Replying to @ScottyBauer1
JS is single-threaded, with an event loop; so a blocking wait primitive would block the whole program (in the browser, the page would be unresponsive; in a nodejs server, connections to all other clients would be unresponsive
1 reply 1 retweet 3 likes
Replying to @tehjh @ScottyBauer1
the "await" stuff is just syntactic sugar that makes nested callbacks look like sequential code
12:56 PM - 22 Apr 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.