mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
fix(type): add clear to AxiosInterceptorManager (#5010)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Vendored
+1
@@ -413,6 +413,7 @@ export interface AxiosInterceptorOptions {
|
||||
export interface AxiosInterceptorManager<V> {
|
||||
use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
|
||||
eject(id: number): void;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
export class Axios {
|
||||
|
||||
@@ -326,6 +326,9 @@ axios.interceptors.response.eject(voidResponseInterceptorId);
|
||||
axios.interceptors.response.use((response: AxiosResponse) => response);
|
||||
axios.interceptors.response.use((response: AxiosResponse) => Promise.resolve(response));
|
||||
|
||||
axios.interceptors.request.clear();
|
||||
axios.interceptors.response.clear();
|
||||
|
||||
// Adapters
|
||||
|
||||
const adapter: AxiosAdapter = (config: AxiosRequestConfig) => {
|
||||
|
||||
Reference in New Issue
Block a user