diff --git a/src/client/stores/CalculationStore/index.ts b/src/client/stores/CalculationStore/index.ts index a7aeae2..e897979 100644 --- a/src/client/stores/CalculationStore/index.ts +++ b/src/client/stores/CalculationStore/index.ts @@ -5,6 +5,7 @@ import { import actionsEffects from 'client/stores/CalculationStore/Effects/action'; // import assignProperties from 'client/tools/assignProps'; import { ICalculationStore } from 'core/types/stores'; +import { isEqual } from 'lodash'; import { autorun, makeAutoObservable, reaction, when } from 'mobx'; import CommonStore from '../CommonStore'; import { @@ -43,11 +44,12 @@ autorunEffects.map(autorunEffect => reactionEffects.map(reactionEffectBuilder => { const reactionEffect = reactionEffectBuilder(CalculationStore); - return reaction( - reactionEffect.expression, - reactionEffect.effect, - reactionEffect.options, - ); + return reaction(reactionEffect.expression, reactionEffect.effect, { + ...reactionEffect.options, + equals: (nextParams, prevParams) => { + return isEqual(nextParams, prevParams); + }, + }); }); whenEffects.map(whenEffectBuilder => {