Skip to content

Instantly share code, notes, and snippets.

@simonschwartz
Last active April 7, 2019 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonschwartz/3c3e9bcc14b587a841ec4b543f575d05 to your computer and use it in GitHub Desktop.
Save simonschwartz/3c3e9bcc14b587a841ec4b543f575d05 to your computer and use it in GitHub Desktop.
const getNodeRepoDetails = () =>
fetch('https://api.github.com/repos/nodejs/node').then(response => response.json());
const getGoRepoDetails = () =>
fetch('https://api.github.com/repos/golang/go').then(response => response.json());
Promise.all([getNodeRepoDetails(), getGoRepoDetails()])
.then(response => {
const [ nodeResponse, goResponse ] = response;
/* handle request response */
})
.catch(error => { /* handle request error */ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment