Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

[Added] instance call with config#254

Merged
jasonsaayman merged 3 commits intoaxios:masterfrom
theo-sim-dev:add-instance-config-call
Jul 28, 2025
Merged

[Added] instance call with config#254
jasonsaayman merged 3 commits intoaxios:masterfrom
theo-sim-dev:add-instance-config-call

Conversation

@theo-sim-dev
Copy link
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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