DEV Community

Discussion on: Modern JavaScript, 10 things you should be using, starting today

Collapse
 
gabrielpedroza profile image
Gabriel Pedroza

Nice job! The only thing that you might reconsider to change if you do is the async/await example. When fetching multiple data from different api's, you should use promise.all instead of async so you can fetch all the data at once instead of waiting for the first one to be finished and to start the second fetch and so on.

Collapse
 
phyberapex profile image
PhyberApex

Not really. If you look at the example he uses the return value of the first await for the second one, so he can't send them in parallel. It's exactly the use case for async/await :)

If there are no dependencies, I'd agree to use promises and a promise.all()

~Cheers