From b95bc3eaa4b3e1e7d4fcdabf25311063e0a8c029 Mon Sep 17 00:00:00 2001 From: Chika Date: Fri, 29 Apr 2022 13:15:50 +0300 Subject: [PATCH] ValuesStore: replace lodash.pick with reduce --- stores/calculation/values.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stores/calculation/values.ts b/stores/calculation/values.ts index 47fb25f..3a002b9 100644 --- a/stores/calculation/values.ts +++ b/stores/calculation/values.ts @@ -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) {