effect-tree - v1.0.36
    Preparing search index...

    Function setValue

    Set the value of a tree root to a given value of the same type.

    import * as Tree from 'effect-tree'

    const leaf = Tree.of(1)
    const changed = Tree.setValue(leaf, 2)

    expect(Tree.getValue(changed)).toBe(2)

    Underlying tree type.

    The tree being changed.

    New value for the root node.

    A new tree where the root value has been replaced by the given value.