unchangeable • Docs
unchangeable / set
set<
T
>(value
,path
,item
,keyIndex
):T
Sets the item
value of a composite value
at a given path
.
If the item
is a function, it is called with the actual item
value as argument and the return value is used to set the item value.
• T
• value: T
The composite value
• path: Path
The path leading to the item in the composite value
• item: any
The value of the item or a function with the old item value as argument and returning the new value of the item
• keyIndex: number
= 0
The index in the path to start from, defaults to 0.
T
An new composite value
or the same value
if no change was necessary.