|
@@ -37,9 +37,9 @@ export const cowWorkshop = (keys, fn = x => x) => (obj, {result = obj, resultKey
|
|
|
keys.forEach((key, index) => {
|
|
|
const value = fn(cowValueModel(key)(obj));
|
|
|
const modifier = cowValueModel(resultKeys[index]);
|
|
|
- const oldDst = result;
|
|
|
- result = modifier(oldDst, value);
|
|
|
- if (result !== oldDst) {
|
|
|
+ const oldResult = result;
|
|
|
+ result = modifier(oldResult, value);
|
|
|
+ if (result !== oldResult) {
|
|
|
diff = modifier(diff, value);
|
|
|
}
|
|
|
});
|