rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
74 lines (35 loc) • 1.01 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [treeIterate](./rc-js-util.treeiterate.md)
## treeIterate() function
Iterates over the whole tree, in a depth first fashion.
**Signature:**
```typescript
export declare function treeIterate<TNode extends ITreeNodeLike<TNode>>(node: TNode, callback: (node: TNode, parent: TNode | null, depth: number) => void): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
node
</td><td>
TNode
</td><td>
The start point.
</td></tr>
<tr><td>
callback
</td><td>
(node: TNode, parent: TNode \| null, depth: number) => void
</td><td>
Called for each node, including the start point.
</td></tr>
</tbody></table>
**Returns:**
void
## Remarks
See [treeIterate()](./rc-js-util.treeiterate.md)<!-- -->.