Skip to content

Commit d74238e

Browse files
guillaumebridayJustinBeckwith
authored andcommitted
Adding second then on axios call (axios#1623)
Inspired by this issue : axios#792 (comment)
1 parent 405fe69 commit d74238e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,15 @@ Performing a `GET` request
5656
// Make a request for a user with a given ID
5757
axios.get('/user?ID=12345')
5858
.then(function (response) {
59+
// handle success
5960
console.log(response);
6061
})
6162
.catch(function (error) {
63+
// handle error
6264
console.log(error);
65+
})
66+
.then(function () {
67+
// always executed
6368
});
6469

6570
// Optionally the request above could also be done as
@@ -73,7 +78,10 @@ axios.get('/user', {
7378
})
7479
.catch(function (error) {
7580
console.log(error);
76-
});
81+
})
82+
.then(function () {
83+
// always executed
84+
});
7785

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

0 commit comments

Comments
 (0)