From 70fdd977d95083027c9193061aa509d1ce6202a9 Mon Sep 17 00:00:00 2001 From: Guillaume Briday Date: Fri, 22 Jun 2018 10:50:19 +0200 Subject: [PATCH] Adding second then on axios call Inspired by this issue : https://github.com/axios/axios/issues/792#issuecomment-289306590 --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c83949a5b..d1f94c8f77 100755 --- a/README.md +++ b/README.md @@ -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 @@ -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() {