import { reaction } from "mobx" ; import { lazyInject } from "../inversify.config" ; import AutoReloadService from "../services/AutoReloadService" ; import SonarQubeMeasuresService from "../services/sonarqube/measures/SonarQubeMeasuresService" ; import CityBuilderStore from "../stores/CityBuilderStore" ; export default class BuilderReactions { @ lazyInject ( "CityBuilderStore" ) private readonly cityBuilderStore ! : CityBuilderStore ; @ lazyInject ( "SonarQubeMeasuresService" ) private readonly measuresService ! : SonarQubeMeasuresService ; @ lazyInject ( "AutoReloadService" ) private readonly autoReloadService ! : AutoReloadService ; constructor ( ) { this . prepareReactions ( ) ; } private prepareReactions ( ) { reaction ( ( ) => this . cityBuilderStore . initiateBuildProcess , ( ) => { if ( this . cityBuilderStore . initiateBuildProcess ) { this . cityBuilderStore . initiateBuildProcess = false ; this . measuresService . loadMeasures ( ) ; this . autoReloadService . startAutoReload ( ) ; } } , { name : "Transfer all required data to the scene" , } ) ; } }