ValuesStore: replace lodash.pick with reduce

This commit is contained in:
Chika 2022-04-29 13:15:50 +03:00
parent b733da22cc
commit b95bc3eaa4

View File

@ -1,4 +1,3 @@
import { pick } from 'lodash';
import { makeAutoObservable } from 'mobx';
import { RootStore } from '../root';
import { Values } from './types';
@ -23,7 +22,10 @@ export class ValuesStore {
}
getValues(valuesNames: Values[]) {
return pick(this.#values, valuesNames);
return valuesNames.reduce((values, valueName) => {
values[valueName] = this.#values[valueName];
return values;
}, {} as CalculationValues);
}
setValue(valueName: Values, value: any) {