Skip to content

Instantly share code, notes, and snippets.

@kepta

kepta/block24.js Secret

Last active February 21, 2018 15:24
Show Gist options
  • Save kepta/36a760d233e4d94213ce04d6eb00fbb1 to your computer and use it in GitHub Desktop.
Save kepta/36a760d233e4d94213ce04d6eb00fbb1 to your computer and use it in GitHub Desktop.
.then(myVal => {
const promA = foo(myVal);
const promB = anotherPromMake(myVal);
return Promise.all([prom, anotherProm])
})
.then(([valA, valB]) => { // putting ES6 destructing to good use
console.log(valA, valB) // all the resolved values
return hungryFunc(valA, valB)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment