import {configure} from "mobx"; import {RootStore} from "../store/RootStore"; import {RouterService} from "../services/RouterService"; import {library} from '@fortawesome/fontawesome-svg-core'; import {fas} from '@fortawesome/free-solid-svg-icons'; import {fab} from "@fortawesome/free-brands-svg-icons"; import {far} from "@fortawesome/free-regular-svg-icons"; import {NotificationService} from "../services/NotificationService"; const initMobX = () => { configure({enforceActions: 'observed'}); console.debug('MobX initialized'); } const initFontAwesome = () => { library.add(fas); library.add(fab); library.add(far); console.debug('FontAwesome initialized'); } const initLibs = () => { initMobX(); initFontAwesome(); console.debug('Libraries initialized'); } const initServices = (rootStore: RootStore) => { RouterService.init(rootStore.routerStore); NotificationService.init(rootStore.notificationStore); console.debug('Services initialized'); } export const initApp = () => { console.debug('Initializing app'); console.debug('>>>>>>>>>>>>>>>>>>>>>>>>'); initLibs(); let rootStore = new RootStore().init(); initServices(rootStore); console.debug('<<<<<<<<<<<<<<<<<<<<<<<<'); console.debug('App initialized'); return rootStore; }