CreateOptions: {
    name: string;
    valuesAtLeaves: boolean;
}

Type declaration

  • name: string
  • valuesAtLeaves: boolean

    If true, only leaf nodes have values. This avoids repetition (important when comparing trees), with semantics being in the tree itself.

    When false (default) values get decomposed down the tree. This makes it easy to get all the data for a branch of the tree.

    Eg if storing { person: { address { state: qld } } } When true, the tree would be:

    person, value: undefined
    + address, value: undefined
    + state, value: 'qld'

    But when false, the tree would be:

    person, value: { address: { state: `qld } }
    + address, value: { state: `qld` }
    + state, value: `qld`