diff --git a/src/client/stores/CalculationStore/index.ts b/src/client/stores/CalculationStore/index.ts index 30ace45..7b1b437 100644 --- a/src/client/stores/CalculationStore/index.ts +++ b/src/client/stores/CalculationStore/index.ts @@ -7,7 +7,6 @@ import actionsEffects from 'client/stores/CalculationStore/Effects/action'; import { ICalculationStore } from 'core/types/Calculation/Store'; import { isEqual } from 'lodash'; import { autorun, makeAutoObservable, reaction, when } from 'mobx'; -import CommonStore from '../CommonStore'; import { tablesActions, tablesData, @@ -38,9 +37,7 @@ const CalculationStore: ICalculationStore = makeAutoObservable( ), ); -autorunEffects.map(autorunEffect => - autorun(autorunEffect(CalculationStore, CommonStore)), -); +autorunEffects.map(autorunEffect => autorun(autorunEffect(CalculationStore))); reactionEffects.map(reactionEffectBuilder => { const reactionEffect = reactionEffectBuilder(CalculationStore); diff --git a/src/core/types/Calculation/Store/effect.ts b/src/core/types/Calculation/Store/effect.ts index 06d7b82..cbc89f7 100644 --- a/src/core/types/Calculation/Store/effect.ts +++ b/src/core/types/Calculation/Store/effect.ts @@ -1,9 +1,6 @@ -import CommonStore from 'client/stores/CommonStore'; import { IReactionOptions, IReactionPublic, Lambda } from 'mobx'; import { ICalculationStore } from './'; -type TCommonStore = typeof CommonStore; - export type ActionsNames = 'createLead' | 'calculate' | 'createKP'; export type TAction = { @@ -11,11 +8,11 @@ export type TAction = { }; export interface IAutorunEffect { - (CalculationStore: ICalculationStore, CommonStore?: TCommonStore): () => void; + (CalculationStore: ICalculationStore): () => void; } export interface IReactionEffect { - (CalculationStore: ICalculationStore, CommonStore?: TCommonStore): { + (CalculationStore: ICalculationStore): { expression: (r: IReactionPublic) => any; effect: (arg: any, prev: any, r: IReactionPublic) => void; options?: IReactionOptions; @@ -23,7 +20,7 @@ export interface IReactionEffect { } export interface IWhenEffect { - (CalculationStore: ICalculationStore, CommonStore?: TCommonStore): { + (CalculationStore: ICalculationStore): { predicate: () => boolean; effect: Lambda; };