mirror of
https://github.com/arthurfiorette/axios-cache-interceptor.git
synced 2025-12-08 17:36:16 +00:00
refactor: moved all "utils" to one folder
This commit is contained in:
parent
ab051fc698
commit
211dd503f4
@ -2,7 +2,7 @@ import { AxiosInstance } from 'axios';
|
||||
import { applyRequestInterceptor } from '../interceptors/request';
|
||||
import { applyResponseInterceptor } from '../interceptors/response';
|
||||
import { MemoryStorage } from '../storage/memory';
|
||||
import { defaultKeyGenerator } from '../utils/key-generator';
|
||||
import { defaultKeyGenerator } from '../util/key-generator';
|
||||
import { AxiosCacheInstance, CacheInstance, CacheProperties } from './types';
|
||||
|
||||
export function createCache(
|
||||
|
||||
@ -6,7 +6,7 @@ import type {
|
||||
AxiosResponse,
|
||||
Method
|
||||
} from 'axios';
|
||||
import { Deferred } from 'src/utils/deferred';
|
||||
import { Deferred } from 'src/util/deferred';
|
||||
import { CachedResponse, CacheStorage } from '../storage/types';
|
||||
|
||||
export type DefaultCacheRequestConfig = AxiosRequestConfig & {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { CachedResponse } from 'src/storage/types';
|
||||
import { AxiosCacheInstance } from '../axios/types';
|
||||
import { CACHED_RESPONSE_STATUS, CACHED_RESPONSE_STATUS_TEXT } from '../constants';
|
||||
import { Deferred } from '../utils/deferred';
|
||||
import { Deferred } from '../util/deferred';
|
||||
|
||||
export function applyRequestInterceptor(axios: AxiosCacheInstance) {
|
||||
axios.interceptors.request.use(async (config) => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { AxiosCacheInstance } from '../axios/types';
|
||||
import { interpretCacheHeader } from './util/interpret-header';
|
||||
import { updateCache } from './util/update-cache';
|
||||
import { updateCache } from '../util/update-cache';
|
||||
|
||||
export function applyResponseInterceptor(axios: AxiosCacheInstance) {
|
||||
axios.interceptors.response.use(async (response) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { AxiosCacheInstance, CacheProperties } from '../../axios';
|
||||
import { AxiosCacheInstance, CacheProperties } from '../axios';
|
||||
|
||||
export async function updateCache(
|
||||
axios: AxiosCacheInstance,
|
||||
Loading…
x
Reference in New Issue
Block a user