News for hackers. Stuff that matters.
Re:I Avoid Async/Await by gorjusborg on Saturday April 16, 2022 @09:25AM (#31052131)
Exactly. Async/await just an alternative way to represent a promise chain.

My feeling is that mixing the use of promise chains and async/await can make code hard to follow, so I ask colleages to not mix them in the same function.

Sure, async/await is syntactic sugar for a generator that chains promises into a promise chain for you. Not sure why you'd care. That is an implementation detail that never gets exposed to the user.

The only time I feel that promise chains are better async/await is when treating Promise as a monad https://blog.bitsrc.io/out-with-async-await-and-in-with-prom...

There are no comments on this comment yet.