Skip to main content

assocDeep()

const assocDeep: <T>(obj) => <K>(prop) => (val) => T = associateDeep

Sets the val of prop in obj. Returning a new, deep copy of the object.

Sets the val of prop in obj. Returning a new, deep copy of the object.

Type Parameters

T

T extends object

The type of the input object.

Parameters

obj

T

The object to set the value on.

Returns

<K>(prop): (val) => T

Type Parameters

K

K extends string | number | symbol

Parameters

prop

K

Returns

(val): T

Parameters

val

T[K]

Returns

T

Remarks

pure function

Example

associateDeep(personStore)('address')({
city: 'Austin',
street: '987 Sample St',
});
// {
// // ...,
// city: 'Austin',
// street: '987 Sample St',
// }

Remarks

pure function