Accesses a nested record at the given path, returning a value and setter.
The value type.
The nested record.
Path segments (strings or arrays of strings).
[value, setValue] — value is undefined if path doesn't exist; setter creates intermediate objects as needed.
[value, setValue]
undefined
const obj = { a: { b: { c: 42 } } };const [value, setValue] = recordAccess<number>(obj, ['a', 'b', 'c']);value; // 42setValue(100);obj.a.b.c; // 100 Copy
const obj = { a: { b: { c: 42 } } };const [value, setValue] = recordAccess<number>(obj, ['a', 'b', 'c']);value; // 42setValue(100);obj.a.b.c; // 100
Accesses a nested record at the given path, returning a value and setter.