BalanceConfig

data class BalanceConfig(val makeTree: (children: List<Any>, positions: List<Int>, length: Int) -> Tree? = null)

Configuration for Tree.balance.

makeTree builds the inner grouping nodes. It defaults to a factory producing anonymous (NodeType.none) trees; the tree it returns is used as-is, so a caller can attach props of its own. It is never used for the top node, which always keeps the balanced tree's own type and props.

Constructors

Link copied to clipboard
constructor(makeTree: (children: List<Any>, positions: List<Int>, length: Int) -> Tree? = null)

Properties

Link copied to clipboard
val makeTree: (children: List<Any>, positions: List<Int>, length: Int) -> Tree?