3 ms·
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 ha
by gorjusborg 5y ago
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-promise-lifting-c42882a474fd https://blog.bitsrc.io/out-with-async-await-and-in-with-prom...