I am new to ReactJS and for my ajax call I tried using the Axios library . This is awesome, but now I would like to know if there is a way to find out if there are pending requests in the axios interceptor, because I would like to show the overlay load every ajax call (if it is not already visible) and remove the overlay when ALL promise is resolved. While I started working with the interceptor:
axios.interceptors.request.use(function (config) {
return config;
}, function (error) {
return Promise.reject(error);
});
And I would like to add something like this:
axios.interceptors.respose.use(function (config) {
return config;
}, function (error) {
return Promise.reject(error);
});
So, how, (if possible) to know if he is the last answer? Before using ReactJs, I used Angular 1.x, and in $http servicewas
$http.pendingRequests
Is there something like $ http service in axioms?