← Back to design patterns mapbehavioral
⛓️
Design Pattern
Chain of Responsibility
Pass a request through handlers until one handles it.
Visual Diagram
Request -> auth -> validation -> controller -> response
When To Use
- ->Express, Koa, or Fastify middleware chains
- ->Validation pipelines
- ->Approval workflows
- ->Support escalation flows
Used in: Express middleware, Koa middleware, error pipelines
chain.js
Live Editor
Loading...
Output
Run code to see output...