aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/src/stores/SharedStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/shared/src/stores/SharedStore.ts')
-rw-r--r--packages/shared/src/stores/SharedStore.ts34
1 files changed, 20 insertions, 14 deletions
diff --git a/packages/shared/src/stores/SharedStore.ts b/packages/shared/src/stores/SharedStore.ts
index f301b9d..0cac3a5 100644
--- a/packages/shared/src/stores/SharedStore.ts
+++ b/packages/shared/src/stores/SharedStore.ts
@@ -26,26 +26,32 @@ import {
26 SnapshotOut, 26 SnapshotOut,
27} from 'mobx-state-tree'; 27} from 'mobx-state-tree';
28 28
29import { globalSettings } from './GlobalSettings'; 29import GlobalSettings from './GlobalSettings';
30import { profile } from './Profile'; 30import Profile from './Profile';
31import { service } from './Service'; 31import Service from './Service';
32 32
33export const sharedStore = types.model('SharedStore', { 33const SharedStore = types.model('SharedStore', {
34 settings: types.optional(globalSettings, {}), 34 settings: types.optional(GlobalSettings, {}),
35 profilesById: types.map(profile), 35 profilesById: types.map(Profile),
36 profiles: types.array(types.reference(profile)), 36 profiles: types.array(types.reference(Profile)),
37 servicesById: types.map(service), 37 servicesById: types.map(Service),
38 services: types.array(types.reference(service)), 38 services: types.array(types.reference(Service)),
39 selectedService: types.safeReference(service), 39 selectedService: types.safeReference(Service),
40 shouldUseDarkColors: false, 40 shouldUseDarkColors: false,
41}); 41});
42 42
43export interface SharedStore extends Instance<typeof sharedStore> {} 43/*
44 eslint-disable-next-line @typescript-eslint/no-redeclare --
45 Intentionally naming the type the same as the store definition.
46*/
47interface SharedStore extends Instance<typeof SharedStore> {}
48
49export default SharedStore;
44 50
45export interface SharedStoreSnapshotIn extends SnapshotIn<typeof sharedStore> {} 51export interface SharedStoreSnapshotIn extends SnapshotIn<typeof SharedStore> {}
46 52
47export interface SharedStoreSnapshotOut 53export interface SharedStoreSnapshotOut
48 extends SnapshotOut<typeof sharedStore> {} 54 extends SnapshotOut<typeof SharedStore> {}
49 55
50export interface SharedStoreListener { 56export interface SharedStoreListener {
51 onSnapshot(snapshot: SharedStoreSnapshotIn): void; 57 onSnapshot(snapshot: SharedStoreSnapshotIn): void;