RootStore.ts 933 B

123456789101112131415161718192021222324252627282930
  1. import { types } from 'mobx-state-tree';
  2. import { SearchStore } from './../SearchStore/SearchStore';
  3. import { NavStore } from './../NavStore/NavStore';
  4. import { ViewStore } from './../ViewStore/ViewStore';
  5. import { FolderStore } from './../FolderStore/FolderStore';
  6. import { PermissionsStore } from './../PermissionsStore/PermissionsStore';
  7. import { TeamsStore } from './../TeamsStore/TeamsStore';
  8. export const RootStore = types.model({
  9. search: types.optional(SearchStore, {
  10. sections: [],
  11. }),
  12. nav: types.optional(NavStore, {}),
  13. permissions: types.optional(PermissionsStore, {
  14. fetching: false,
  15. items: [],
  16. }),
  17. view: types.optional(ViewStore, {
  18. path: '',
  19. query: {},
  20. routeParams: {},
  21. }),
  22. folder: types.optional(FolderStore, {}),
  23. teams: types.optional(TeamsStore, {
  24. map: {},
  25. }),
  26. });
  27. type RootStoreType = typeof RootStore.Type;
  28. export interface RootStoreInterface extends RootStoreType {}