Skip to content

onion-interceptorDocs


函数: createInterceptor()

createInterceptor(instance?, useAxios?): OnionInterceptor

创建 OnionInterceptor实例

参数

参数名类型默认值描述
instance?AxiosInstanceLike<RequestConfig, RequestResponse>undefined类Axios实例
useAxios?booleantrue是否使用的 Axios 实例

返回值类型

OnionInterceptor

示例

typescript
import { createInterceptor } from "onion-interceptor";
import axios from "axios";

const http = axios.create({...})
createInterceptor(http).use(...)

查看源码

index.ts:24

Released under the MIT License.