Skip to content

Instantly share code, notes, and snippets.

@kepta

kepta/block15.js Secret

Last active February 21, 2018 15:02
Show Gist options
  • Save kepta/201f68a2dc2eb7c498096eca1cd66689 to your computer and use it in GitHub Desktop.
Save kepta/201f68a2dc2eb7c498096eca1cd66689 to your computer and use it in GitHub Desktop.
var prom1 = Promise.resolve(5);
var prom2 = fetchServerStatus(); // returns a promise of {statusCode: 200}
Proimise.all([prom1, prom2])
.then([val1, val2] => { // notice that it resolves into an Array
console.log(val1); // 5
console.log(val2.statusCode); // 200
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment