Skip to content
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

Enhance + Types for AxiosInterceptorOptions #4444

Closed
wants to merge 3 commits into from

Conversation

iomariani
Copy link

@iomariani iomariani commented Feb 4, 2022

This enhances the PR #2702 by doing:

  • Add the runWhen check for response interceptor (previously was only for requests)
  • Adds the missing types on the interceptor options
interface AxiosInterceptorOptions {
  runWhen?(config: AxiosRequestConfig): boolean
  synchronous?: boolean
}

interface AxiosInterceptorManager<V> {
  use<T = V>(onFulfilled?: (value: V) => T | Promise<T>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
  eject(id: number): void;
}

@jasonsaayman
Copy link
Member

Thanks for the pull request, I am going to close this as it seems the functionality is already in the master branch. Please re-open if you still think this is relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants