Skip to content

[Added] instance call with config #254

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

Merged
merged 3 commits into from
Jul 28, 2025

Conversation

theo-sim-dev
Copy link
Contributor

Fixes #252

What's Added

  • A new section: "Calling the instance with a config object" (in English and other languages)
  • Code example showing instance({ url, method }) usage
  • Example retry pattern using error.config in an interceptor (commonly used in token refresh scenarios)

Why This Matters

While this behavior is supported and commonly used, it is not explicitly mentioned in the instance docs. Many developers discover it only through source code or trial-and-error. Documenting it helps with:

  • Discoverability of advanced usage
  • Retry logic based on error.config
  • Cleaner, DRY error handling implementations

Copy link
Member

@jasonsaayman jasonsaayman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nicely done thanks

@jasonsaayman jasonsaayman merged commit b30a0c9 into axios:master Jul 28, 2025
4 checks passed
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.

Docs should clarify that Axios instances are callable functions
2 participants