RootStore.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { types } from 'mobx-state-tree';
  2. import { SearchStore } from './../SearchStore/SearchStore';
  3. import { ServerStatsStore } from './../ServerStatsStore/ServerStatsStore';
  4. import { NavStore } from './../NavStore/NavStore';
  5. import { AlertListStore } from './../AlertListStore/AlertListStore';
  6. import { ViewStore } from './../ViewStore/ViewStore';
  7. import { FolderStore } from './../FolderStore/FolderStore';
  8. import { PermissionsStore } from './../PermissionsStore/PermissionsStore';
  9. export const RootStore = types.model({
  10. search: types.optional(SearchStore, {
  11. sections: [],
  12. }),
  13. serverStats: types.optional(ServerStatsStore, {
  14. stats: [],
  15. }),
  16. nav: types.optional(NavStore, {}),
  17. alertList: types.optional(AlertListStore, {
  18. rules: [],
  19. }),
  20. permissions: types.optional(PermissionsStore, {
  21. fetching: false,
  22. canUpdate: false,
  23. items: [],
  24. }),
  25. view: types.optional(ViewStore, {
  26. path: '',
  27. query: {},
  28. routeParams: {},
  29. }),
  30. folder: types.optional(FolderStore, {}),
  31. });
  32. type IRootStoreType = typeof RootStore.Type;
  33. export interface IRootStore extends IRootStoreType {}