You are viewing a single comment's thread from:

RE: Understanding async-await in Javascript

in #javascript6 years ago

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 😀
Sort:  

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.

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 62065.67
ETH 2429.85
USDT 1.00
SBD 2.68