@dxos/echo
    Preparing search index...

    Function getValue

    • Get a deeply nested property from an object.

      Similar to lodash.get and getDeep from @dxos/util. This is the complementary function to setValue. Accepts both reactive objects and snapshots.

      Parameters

      • obj: Obj.Unknown | Obj.Snapshot<Obj.Unknown>

        The ECHO object to get the property from.

      • path: readonly (string | number)[]

        Path to the property (array of keys).

      Returns any

      The value at the path, or undefined if not found.

      const person = Obj.make(Person, {
      name: 'John',
      addresses: [{ street: '123 Main St' }]
      });

      Obj.getValue(person, ['addresses', 0, 'street']); // '123 Main St'
      Obj.getValue(person, ['addresses', 1, 'street']); // undefined

      O(path length) property walk; no schema lookup.