mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +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> {
|
export interface AxiosInterceptorManager<V> {
|
||||||
use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
|
use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
|
||||||
eject(id: number): void;
|
eject(id: number): void;
|
||||||
|
clear(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Axios {
|
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) => response);
|
||||||
axios.interceptors.response.use((response: AxiosResponse) => Promise.resolve(response));
|
axios.interceptors.response.use((response: AxiosResponse) => Promise.resolve(response));
|
||||||
|
|
||||||
|
axios.interceptors.request.clear();
|
||||||
|
axios.interceptors.response.clear();
|
||||||
|
|
||||||
// Adapters
|
// Adapters
|
||||||
|
|
||||||
const adapter: AxiosAdapter = (config: AxiosRequestConfig) => {
|
const adapter: AxiosAdapter = (config: AxiosRequestConfig) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user