Skip to content

Instantly share code, notes, and snippets.

@allangrds
Created October 26, 2020 20:55
Show Gist options
  • Save allangrds/aa2c1bc52ac8860dca289e010257db89 to your computer and use it in GitHub Desktop.
Save allangrds/aa2c1bc52ac8860dca289e010257db89 to your computer and use it in GitHub Desktop.
axios.all([
axios.get('https://api.github.com/users/iliakan'),
axios.get('https://api.github.com/users/taylorotwell')
])
.then(axios.spread((obj1, obj2) => {
// Ambas requests foram finalizadas
console.log(obj1.data.login + ' has ' + obj1.data.public_repos + ' public repos on GitHub');
console.log(obj2.data.login + ' has ' + obj2.data.public_repos + ' public repos on GitHub');
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment