Re:Request’s Past, Present and Future
by tlrobinson on Monday April 08, 2019 @12:01PM
(#19606412)
When you add asynchronous operations, whether they use promises or callbacks, they tend to spread beacause any consumer of an async operation probably needs to be async itself. That’s not specific to promises.
If you return a promise you don’t really need to support a callback because you can just call .then on the promise with a callback. i.e.
IMHO promise-based APIs are strictly better than callback/“errback” style APIs for many reasons, async/await support in the language being the nail in the coffin.
If you return a promise you don’t really need to support a callback because you can just call .then on the promise with a callback. i.e.
Is equivalent to IMHO promise-based APIs are strictly better than callback/“errback” style APIs for many reasons, async/await support in the language being the nail in the coffin.