mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
Interceptor clear (#4248)
* Adding interceptor clearing * Fixing spacing * changed clear to empty array * fixed interceptor clear test Co-authored-by: Andrew <Andrew@Andrews-MacBook-Pro.local> Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -35,6 +35,15 @@ InterceptorManager.prototype.eject = function eject(id) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear all interceptors from the stack
|
||||
*/
|
||||
InterceptorManager.prototype.clear = function clear() {
|
||||
if (this.handlers) {
|
||||
this.handlers = [];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Iterate over all the registered interceptors
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user