0

i used to use the generator function, and it is really easy to use. when i want to do multiple asynchronous calls, i just simple use code like this

// all calls will be execute in the same time (no wait) const resultA = yield callServiceA() const resultB = yield callServiceB() const resultC = yield callServiceC() if (resultA && resultB && resultC) { // we got results from all services now, } 

how to migrate the code above to use async and await keyword on node.js version 7 or above

2
  • 1
    @josh3736, please answer my question Commented Jul 14, 2017 at 4:16
  • Oops, wrong link. Actually answered here: stackoverflow.com/questions/35612428/… Commented Jul 14, 2017 at 20:22

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.