Refactored computations again, split into multiple files, lots still to do
This commit is contained in:
16
app/imports/api/creature/computation/logAlterations.js
Normal file
16
app/imports/api/creature/computation/logAlterations.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { isEqual, forOwn } from 'lodash';
|
||||
import { ComputedOnlySkilLSchema } from '/imports/api/properties/Skills.js';
|
||||
|
||||
export default function logAlterations(memo){
|
||||
forOwn(memo.originalPropsById, old => {
|
||||
let changed = memo.propsById[old._id];
|
||||
delete changed.computationDetails;
|
||||
|
||||
if (!isEqual(old, changed)){
|
||||
console.log({change: {old, changed}})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO use this as a starting point to write only computed fields that have
|
||||
// changed
|
||||
Reference in New Issue
Block a user