9.14 Removing Interceptors
You learned how to add an interceptor
, getting rid of one is also easy. Simply store the reference to the interceptor in a variable and call eject
with that reference as an argument, to remove it (Read more: github.com: Interceptors):
let myInterceptor = axios.interceptors.request.use(() => {
/*...*/
});
axios.interceptors.request.eject(myInterceptor);