|
@@ -74,14 +74,13 @@ export const deepCopyOnWrite = (...keyDescriptions) => {
|
|
|
export const decow = deepCopyOnWrite;
|
|
|
|
|
|
export const cowValueModel = (...keyDescriptions) => {
|
|
|
- const keys = constructKeys(keyDescriptions);
|
|
|
-
|
|
|
const GET_SENTINEL = {};
|
|
|
|
|
|
return (obj, val = GET_SENTINEL) =>
|
|
|
- val === GET_SENTINEL ?
|
|
|
- deepGet(keys, obj) :
|
|
|
- deepPut(keys, obj, val);
|
|
|
+ (val === GET_SENTINEL ?
|
|
|
+ deget(...keyDescriptions) :
|
|
|
+ decow(...keyDescriptions)(val))
|
|
|
+ (obj);
|
|
|
};
|
|
|
|
|
|
export const cowWorkshop = (keys, fn = x => x) => (obj, {result = obj, resultKeys = keys, diff} = {}) => {
|