Created
September 3, 2019 22:47
-
-
Save jackpordi/c9d8bebf2578a78917f2e10a0ca420b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeSoup() { | |
return Promise.all([ | |
new Promise((reject, resolve) => { | |
chopCarrots(); | |
chopOnions(); | |
resolve(); | |
}), | |
boilPot() | |
]).then(() => { | |
addCarrots(); | |
return letPotKeepBoiling(5); | |
}).then(() => { | |
addOnions(); | |
return letPotKeepBoiling(10); | |
}).then(() => { | |
console.log("Vegetable soup done!"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment