Since I started using promises my JS experience totally changed. I hated asynchronous functions and callback hell. Now I use promises whenever I can, and sometimes Promise.all for parallel execution. A note for Steem developers, the Steem-JS library has built-in promises using Bluebird, add Async
to any function to transform it into a promise (e.g. steem.api.getWitnesses
becomes steem.api.getWitnessesAsync
)
P.S.
- You have a typo
aync functions returns a promise.
- I lost count of how many times I wrote promise in my comment 😀
Very true. I gave node a try a couple of years ago and didn't pursue further because of call back hell. Promises makes it so much better and async makes it very easy. As you mentioned I have been using *Async in steemJS of late.