axios-cache-interceptor
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -14,7 +14,10 @@ import { AxiosInstance, AxiosRequestConfig } from 'axios'; | ||
* | ||
* @param config The config for the caching interceptors | ||
* @param axiosConfig The config for the created axios instance | ||
* @returns The same instance but with caching enabled | ||
* @param config The config for the caching interceptors and the axios instance | ||
* @returns A new AxiosCacheInstance with caching enabled | ||
*/ | ||
export declare function createCache(config?: Partial<CacheInstance> & Partial<CacheProperties>, axiosConfig?: AxiosRequestConfig): AxiosCacheInstance; | ||
export declare function createCache({ axios, cache }?: CreateCacheOptions): AxiosCacheInstance; | ||
export declare type CreateCacheOptions = { | ||
axios?: Partial<AxiosRequestConfig>; | ||
cache?: Partial<CacheInstance> & Partial<CacheProperties>; | ||
}; | ||
//# sourceMappingURL=cache.d.ts.map |
@@ -53,10 +53,9 @@ "use strict"; | ||
* | ||
* @param config The config for the caching interceptors | ||
* @param axiosConfig The config for the created axios instance | ||
* @returns The same instance but with caching enabled | ||
* @param config The config for the caching interceptors and the axios instance | ||
* @returns A new AxiosCacheInstance with caching enabled | ||
*/ | ||
function createCache(config = {}, axiosConfig = {}) { | ||
return applyCache(axios_1.default.create(axiosConfig), config); | ||
function createCache({ axios = {}, cache = {} } = {}) { | ||
return applyCache(axios_1.default.create(axios), cache); | ||
} | ||
exports.createCache = createCache; | ||
//# sourceMappingURL=cache.js.map |
{ | ||
"name": "axios-cache-interceptor", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "Cache interceptor for axios", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -64,11 +64,15 @@ import Axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; | ||
* | ||
* @param config The config for the caching interceptors | ||
* @param axiosConfig The config for the created axios instance | ||
* @returns The same instance but with caching enabled | ||
* @param config The config for the caching interceptors and the axios instance | ||
* @returns A new AxiosCacheInstance with caching enabled | ||
*/ | ||
export function createCache( | ||
config: Partial<CacheInstance> & Partial<CacheProperties> = {}, | ||
axiosConfig: AxiosRequestConfig = {} | ||
): AxiosCacheInstance { | ||
return applyCache(Axios.create(axiosConfig), config); | ||
export function createCache({ | ||
axios = {}, | ||
cache = {} | ||
}: CreateCacheOptions = {}): AxiosCacheInstance { | ||
return applyCache(Axios.create(axios), cache); | ||
} | ||
export type CreateCacheOptions = { | ||
axios?: Partial<AxiosRequestConfig>; | ||
cache?: Partial<CacheInstance> & Partial<CacheProperties>; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119783
1599