TDMS/web/src/utils/init.ts
Maksim Skobaro c2d19a7724 improved, more featured, fixed
Exceptions and Errors are better
Files structure is better
New ComponentContext.ts
New DataTable.tsx tables.ts
Massive components refactoring
New Group.java
New LoggingRequestFilter.java LoggingSessionListener.java
New NotificationStore.ts SysInfoStore.ts
New reactiveValue.ts ReactiveControls.tsx
New dependencies
And much more
2025-02-07 07:05:15 +03:00

48 lines
1.3 KiB
TypeScript

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;
}