async function makePizza(sauceType = 'red') { let doughPromise = makeDough(); let saucePromise = makeSauce(sauceType); let sauce = await saucePromise; let cheese = await grateCheese(sauce.determineCheese()); let dough = await doughPromise; dough.add(sauce); dough.add(cheese); return dough; }
Even with async/await, raw promises are still key to writing optimal concurrent javascript
Daniel Brain
2.2K38

Great and clean example how to code with async/await syntax.