Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 880 Bytes

types.uniontype.accept.md

File metadata and controls

27 lines (16 loc) · 880 Bytes

Home > @skunkteam/types > UnionType > accept

UnionType.accept() method

Accept a visitor (visitor pattern).

Signature:

accept<R>(visitor: Visitor<R>): R;

Parameters

Parameter Type Description
visitor Visitor<R> the visitor to accept

Returns:

R

Remarks

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.