axios-pluginify
Version:
`axios-pluginify` 是一款极小的工具, 可以让 `axios` 成为基于插件的请求库.
18 lines • 424 B
JavaScript
export class AxiosCacheAdapter {
constructor(adapter) {
this.adapter = adapter;
}
beforeCreate(config) {
config.adapter = this.adapter.adapter;
}
}
export class AxiosRetry {
constructor(config, retry) {
this.config = config;
this.retry = retry;
}
created(axios) {
this.retry(axios, this.config);
}
}
//# sourceMappingURL=plugins.js.map