Skip to content

docs: add custom interceptor example#5548

Merged
mcollina merged 1 commit into
nodejs:mainfrom
vibhor-aggr:docs/interceptor-examples
Jul 11, 2026
Merged

docs: add custom interceptor example#5548
mcollina merged 1 commit into
nodejs:mainfrom
vibhor-aggr:docs/interceptor-examples

Conversation

@vibhor-aggr

Copy link
Copy Markdown
Contributor

Fixes #3218.

This adds a custom interceptor example to the Interceptors API documentation. The new section shows the current Dispatcher.compose() pattern and demonstrates how to wrap and forward handler callbacks while measuring response timing.

It also links readers from the Dispatcher.compose() documentation to the new custom example and points from the example back to the full dispatcher.dispatch(options, handler) callback reference.

Validation:

  • git diff --check
  • npm run lint
  • npm run test:typescript

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.44%. Comparing base (ecf714f) to head (cec5714).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5548   +/-   ##
=======================================
  Coverage   93.44%   93.44%           
=======================================
  Files         110      110           
  Lines       37418    37418           
=======================================
  Hits        34967    34967           
  Misses       2451     2451           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@mcollina
mcollina merged commit 4708df1 into nodejs:main Jul 11, 2026
36 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 20, 2026
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.

Improve docs on Interceptors

3 participants