Home > @skunkteam/types > UnionType > accept
Accept a visitor (visitor pattern).
Signature:
accept<R>(visitor: Visitor<R>): R;
Parameter | Type | Description |
---|---|---|
visitor | Visitor<R> | the visitor to accept |
Returns:
R
Note that, while it can be used to traverse a tree, this is not part of this pattern. The visitor that visits a particular type can decide to visit children of that type (or not). See ./testutils.ts
for an example.