Skip to main content

branch()

branch<T>(data, children): Branch<T>

Creates a branch node with children.


Type Parameters​

T: T​

The data type


Parameters​

data: T​

The branch's data

children: Composite<T>[]​

Child nodes


Returns: Branch<T>​

A Branch node


Since​

2.4.0

Branch<T>​

Type

Branch<T> = object

A Branch node contains data and children.


Since​

2.4.0


Type Parameters​

T: T​

The data type stored in nodes


Properties​

type: "branch"​

data: T​

children​

readonly children: ReadonlyArray<Composite<T>>