Skip to content

docs: fix interceptor eject example to use correct instance#10853

Merged
jasonsaayman merged 1 commit into
axios:v1.xfrom
divyanshuraj1095:fix-interceptor-doc
May 6, 2026
Merged

docs: fix interceptor eject example to use correct instance#10853
jasonsaayman merged 1 commit into
axios:v1.xfrom
divyanshuraj1095:fix-interceptor-doc

Conversation

@divyanshuraj1095
Copy link
Copy Markdown
Contributor

@divyanshuraj1095 divyanshuraj1095 commented May 6, 2026

Fix interceptor eject example in README

The example creates an interceptor using an Axios instance but attempts to eject it using the global axios object. Updated the code to use the correct instance for consistency and clarity.


Summary by cubic

Fix the interceptor eject example to use the created axios instance instead of the global axios object. This prevents confusion and shows the correct way to remove an interceptor from an instance.

Description

  • Summary of changes: Updated README to call instance.interceptors.request.eject(myInterceptor) instead of axios.interceptors.request.eject(myInterceptor).
  • Reasoning: The interceptor is registered on instance, so ejecting on axios would not remove it and misleads readers.
  • Additional context: Docs-only; no runtime changes.

Docs

  • Mirror this fix in any code samples on the docs site under /docs/ to keep examples consistent.

Testing

  • No tests added; documentation-only change. Tests not needed.

Semantic version impact

  • No impact. Docs-only change; no release required.

Written for commit 719903e. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@jasonsaayman jasonsaayman merged commit 23fd0a6 into axios:v1.x May 6, 2026
3 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.

2 participants