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.
The ECHO object to get the property from.
Path to the property (array of keys).
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 Copy
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.
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.