Skip to content

Commit

Permalink
Adding second then on axios call (#1623)
Browse files Browse the repository at this point in the history
Inspired by this issue : #792 (comment)
  • Loading branch information
guillaumebriday authored and JustinBeckwith committed Jul 2, 2018
1 parent 405fe69 commit d74238e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -56,10 +56,15 @@ Performing a `GET` request
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});

// Optionally the request above could also be done as
Expand All @@ -73,7 +78,10 @@ axios.get('/user', {
})
.catch(function (error) {
console.log(error);
});
})
.then(function () {
// always executed
});

// Want to use async/await? Add the `async` keyword to your outer function/method.
async function getUser() {
Expand Down

0 comments on commit d74238e

Please sign in to comment.