Skip to content

Instantly share code, notes, and snippets.

@jackpordi
Created September 3, 2019 22:47
Show Gist options
  • Save jackpordi/c9d8bebf2578a78917f2e10a0ca420b2 to your computer and use it in GitHub Desktop.
Save jackpordi/c9d8bebf2578a78917f2e10a0ca420b2 to your computer and use it in GitHub Desktop.
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