← Back to design patterns mapbehavioral
Design Pattern
Visitor
Add operations to object structures without changing those objects.
Visual Diagram
Visitor -> visitUser() -> visitOrder() -> visitInvoice()
When To Use
- ->AST transforms
- ->Linting rules
- ->Tree traversal with many operations
- ->Exporting different object types
Used in: AST transforms, Babel plugins, tree walkers
visitor.js
Live Editor
Loading...
Output
Run code to see output...
Comments
Sign in to leave a comment. Your name and photo come from Google; nothing else is shared.
Loading comments...
On this page
0 sections