-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error while using useCache flag #58
Comments
You need the typing
|
Merged
here is the solution https://github.com/kuitos/axios-extensions#custom-cache-typing |
I try not to comment on closed issues but...
using the solution above. |
Oh, I guess the change not released yet. |
released v3.1.2, thanks for your feedback~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
axios.ts file
const axiosAppInstance = axios.create({
// @ts-ignore
adapter: cacheAdapterEnhancer(axios.defaults.adapter, { enabledByDefault: false, cacheFlag: 'useCache'}),
baseURL: appConfig.getRequired('abc'),
});
abc.ts file
axiosAppInstance.get('xyz',{ useCache: true }),
TypeScript error
Argument of type '{ useCache: boolean; }' is not assignable to parameter of type 'AxiosRequestConfig'.
Object literal may only specify known properties, and 'useCache' does not exist in type 'AxiosRequestConfig'.ts
The text was updated successfully, but these errors were encountered: