diff options
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.ts | 2 | ||||
-rw-r--r-- | src/stores/GlobalErrorStore.ts | 2 | ||||
-rw-r--r-- | src/stores/RecipePreviewsStore.ts | 2 | ||||
-rw-r--r-- | src/stores/RecipesStore.ts | 2 | ||||
-rw-r--r-- | src/stores/RequestStore.ts | 2 | ||||
-rw-r--r-- | src/stores/ServicesStore.ts | 2 | ||||
-rw-r--r-- | src/stores/SettingsStore.ts | 2 | ||||
-rw-r--r-- | src/stores/UIStore.ts | 2 | ||||
-rw-r--r-- | src/stores/UserStore.ts | 2 | ||||
-rw-r--r-- | src/stores/index.ts | 22 | ||||
-rw-r--r-- | src/stores/lib/TypedStore.ts | 2 |
11 files changed, 29 insertions, 13 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index 5659460c6..f333a0060 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts | |||
@@ -14,7 +14,7 @@ import ms from 'ms'; | |||
14 | import { URL } from 'url'; | 14 | import { URL } from 'url'; |
15 | import { readJsonSync } from 'fs-extra'; | 15 | import { readJsonSync } from 'fs-extra'; |
16 | 16 | ||
17 | import { Stores } from 'src/stores.types'; | 17 | import { Stores } from 'src/@types/stores.types'; |
18 | import { ApiInterface } from 'src/api'; | 18 | import { ApiInterface } from 'src/api'; |
19 | import { Actions } from 'src/actions/lib/actions'; | 19 | import { Actions } from 'src/actions/lib/actions'; |
20 | import TypedStore from './lib/TypedStore'; | 20 | import TypedStore from './lib/TypedStore'; |
diff --git a/src/stores/GlobalErrorStore.ts b/src/stores/GlobalErrorStore.ts index cb364574b..fcc1276c8 100644 --- a/src/stores/GlobalErrorStore.ts +++ b/src/stores/GlobalErrorStore.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { observable, action } from 'mobx'; | 1 | import { observable, action } from 'mobx'; |
2 | import { Actions } from 'src/actions/lib/actions'; | 2 | import { Actions } from 'src/actions/lib/actions'; |
3 | import { ApiInterface } from 'src/api'; | 3 | import { ApiInterface } from 'src/api'; |
4 | import { Stores } from 'src/stores.types'; | 4 | import { Stores } from 'src/@types/stores.types'; |
5 | import Request from './lib/Request'; | 5 | import Request from './lib/Request'; |
6 | import TypedStore from './lib/TypedStore'; | 6 | import TypedStore from './lib/TypedStore'; |
7 | 7 | ||
diff --git a/src/stores/RecipePreviewsStore.ts b/src/stores/RecipePreviewsStore.ts index 500f69b40..099867785 100644 --- a/src/stores/RecipePreviewsStore.ts +++ b/src/stores/RecipePreviewsStore.ts | |||
@@ -2,7 +2,7 @@ import { action, computed, observable } from 'mobx'; | |||
2 | import { Actions } from 'src/actions/lib/actions'; | 2 | import { Actions } from 'src/actions/lib/actions'; |
3 | import { ApiInterface } from 'src/api'; | 3 | import { ApiInterface } from 'src/api'; |
4 | import Recipe from 'src/models/Recipe'; | 4 | import Recipe from 'src/models/Recipe'; |
5 | import { Stores } from 'src/stores.types'; | 5 | import { Stores } from 'src/@types/stores.types'; |
6 | 6 | ||
7 | import CachedRequest from './lib/CachedRequest'; | 7 | import CachedRequest from './lib/CachedRequest'; |
8 | import Request from './lib/Request'; | 8 | import Request from './lib/Request'; |
diff --git a/src/stores/RecipesStore.ts b/src/stores/RecipesStore.ts index af2aa7fb0..d63e46bef 100644 --- a/src/stores/RecipesStore.ts +++ b/src/stores/RecipesStore.ts | |||
@@ -2,7 +2,7 @@ import { action, computed, observable } from 'mobx'; | |||
2 | import { readJSONSync } from 'fs-extra'; | 2 | import { readJSONSync } from 'fs-extra'; |
3 | import semver from 'semver'; | 3 | import semver from 'semver'; |
4 | 4 | ||
5 | import { Stores } from 'src/stores.types'; | 5 | import { Stores } from 'src/@types/stores.types'; |
6 | import { ApiInterface } from 'src/api'; | 6 | import { ApiInterface } from 'src/api'; |
7 | import { Actions } from 'src/actions/lib/actions'; | 7 | import { Actions } from 'src/actions/lib/actions'; |
8 | import Recipe from 'src/models/Recipe'; | 8 | import Recipe from 'src/models/Recipe'; |
diff --git a/src/stores/RequestStore.ts b/src/stores/RequestStore.ts index 03ad2c7db..af686388a 100644 --- a/src/stores/RequestStore.ts +++ b/src/stores/RequestStore.ts | |||
@@ -4,7 +4,7 @@ import ms from 'ms'; | |||
4 | 4 | ||
5 | import { Actions } from 'src/actions/lib/actions'; | 5 | import { Actions } from 'src/actions/lib/actions'; |
6 | import { ApiInterface } from 'src/api'; | 6 | import { ApiInterface } from 'src/api'; |
7 | import { Stores } from 'src/stores.types'; | 7 | import { Stores } from 'src/@types/stores.types'; |
8 | import CachedRequest from './lib/CachedRequest'; | 8 | import CachedRequest from './lib/CachedRequest'; |
9 | import { LOCAL_PORT } from '../config'; | 9 | import { LOCAL_PORT } from '../config'; |
10 | 10 | ||
diff --git a/src/stores/ServicesStore.ts b/src/stores/ServicesStore.ts index caa44146f..0164d092a 100644 --- a/src/stores/ServicesStore.ts +++ b/src/stores/ServicesStore.ts | |||
@@ -5,7 +5,7 @@ import ms from 'ms'; | |||
5 | import { ensureFileSync, pathExistsSync, writeFileSync } from 'fs-extra'; | 5 | import { ensureFileSync, pathExistsSync, writeFileSync } from 'fs-extra'; |
6 | import { join } from 'path'; | 6 | import { join } from 'path'; |
7 | 7 | ||
8 | import { Stores } from 'src/stores.types'; | 8 | import { Stores } from 'src/@types/stores.types'; |
9 | import { ApiInterface } from 'src/api'; | 9 | import { ApiInterface } from 'src/api'; |
10 | import { Actions } from 'src/actions/lib/actions'; | 10 | import { Actions } from 'src/actions/lib/actions'; |
11 | import Request from './lib/Request'; | 11 | import Request from './lib/Request'; |
diff --git a/src/stores/SettingsStore.ts b/src/stores/SettingsStore.ts index 524f2e50c..dabd7b099 100644 --- a/src/stores/SettingsStore.ts +++ b/src/stores/SettingsStore.ts | |||
@@ -2,7 +2,7 @@ import { ipcRenderer } from 'electron'; | |||
2 | import { getCurrentWindow } from '@electron/remote'; | 2 | import { getCurrentWindow } from '@electron/remote'; |
3 | import { action, computed, observable, reaction } from 'mobx'; | 3 | import { action, computed, observable, reaction } from 'mobx'; |
4 | import localStorage from 'mobx-localstorage'; | 4 | import localStorage from 'mobx-localstorage'; |
5 | import { Stores } from 'src/stores.types'; | 5 | import { Stores } from 'src/@types/stores.types'; |
6 | import { ApiInterface } from 'src/api'; | 6 | import { ApiInterface } from 'src/api'; |
7 | import { Actions } from 'src/actions/lib/actions'; | 7 | import { Actions } from 'src/actions/lib/actions'; |
8 | import { | 8 | import { |
diff --git a/src/stores/UIStore.ts b/src/stores/UIStore.ts index 306b14cb1..e9e099ebc 100644 --- a/src/stores/UIStore.ts +++ b/src/stores/UIStore.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { action, observable, computed, reaction } from 'mobx'; | 1 | import { action, observable, computed, reaction } from 'mobx'; |
2 | import { nativeTheme } from '@electron/remote'; | 2 | import { nativeTheme } from '@electron/remote'; |
3 | 3 | ||
4 | import { Stores } from 'src/stores.types'; | 4 | import { Stores } from 'src/@types/stores.types'; |
5 | import { ApiInterface } from 'src/api'; | 5 | import { ApiInterface } from 'src/api'; |
6 | import { Actions } from 'src/actions/lib/actions'; | 6 | import { Actions } from 'src/actions/lib/actions'; |
7 | import { Theme, theme, ThemeType } from '../themes'; | 7 | import { Theme, theme, ThemeType } from '../themes'; |
diff --git a/src/stores/UserStore.ts b/src/stores/UserStore.ts index 616ff29a6..0827f8196 100644 --- a/src/stores/UserStore.ts +++ b/src/stores/UserStore.ts | |||
@@ -6,7 +6,7 @@ import { ipcRenderer } from 'electron'; | |||
6 | 6 | ||
7 | import { ApiInterface } from 'src/api'; | 7 | import { ApiInterface } from 'src/api'; |
8 | import { Actions } from 'src/actions/lib/actions'; | 8 | import { Actions } from 'src/actions/lib/actions'; |
9 | import { Stores } from 'src/stores.types'; | 9 | import { Stores } from 'src/@types/stores.types'; |
10 | import { TODOS_PARTITION_ID } from '../config'; | 10 | import { TODOS_PARTITION_ID } from '../config'; |
11 | import { isDevMode } from '../environment-remote'; | 11 | import { isDevMode } from '../environment-remote'; |
12 | import Request from './lib/Request'; | 12 | import Request from './lib/Request'; |
diff --git a/src/stores/index.ts b/src/stores/index.ts index a5b1a7452..aac501cda 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | import { Stores } from 'src/stores.types'; | ||
2 | import { RouterStore } from 'mobx-react-router'; | 1 | import { RouterStore } from 'mobx-react-router'; |
3 | import { ApiInterface } from 'src/api'; | 2 | import { ApiInterface } from 'src/api'; |
4 | import { Actions } from 'src/actions/lib/actions'; | 3 | import { Actions } from 'src/actions/lib/actions'; |
@@ -16,12 +15,29 @@ import { workspaceStore } from '../features/workspaces'; | |||
16 | import { communityRecipesStore } from '../features/communityRecipes'; | 15 | import { communityRecipesStore } from '../features/communityRecipes'; |
17 | import { todosStore } from '../features/todos'; | 16 | import { todosStore } from '../features/todos'; |
18 | 17 | ||
18 | export interface RealStores { | ||
19 | router: RouterStore; | ||
20 | app: AppStore; | ||
21 | user: UserStore; | ||
22 | features: FeaturesStore; | ||
23 | settings: SettingsStore; | ||
24 | services: ServicesStore; | ||
25 | recipes: RecipesStore; | ||
26 | recipePreviews: RecipePreviewsStore; | ||
27 | ui: UIStore; | ||
28 | requests: RequestStore; | ||
29 | globalError: GlobalErrorStore; | ||
30 | workspaces: typeof workspaceStore; | ||
31 | communityRecipes: typeof communityRecipesStore; | ||
32 | todos: typeof todosStore; | ||
33 | } | ||
34 | |||
19 | export default ( | 35 | export default ( |
20 | api: ApiInterface, | 36 | api: ApiInterface, |
21 | actions: Actions, | 37 | actions: Actions, |
22 | router: RouterStore, | 38 | router: RouterStore, |
23 | ): Stores => { | 39 | ): RealStores => { |
24 | const stores: Stores | any = {}; | 40 | const stores: RealStores | any = {}; |
25 | Object.assign(stores, { | 41 | Object.assign(stores, { |
26 | router, | 42 | router, |
27 | app: new AppStore(stores, api, actions), | 43 | app: new AppStore(stores, api, actions), |
diff --git a/src/stores/lib/TypedStore.ts b/src/stores/lib/TypedStore.ts index 7f9d2d60f..c78f83850 100644 --- a/src/stores/lib/TypedStore.ts +++ b/src/stores/lib/TypedStore.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { computed, IReactionPublic, observable } from 'mobx'; | 1 | import { computed, IReactionPublic, observable } from 'mobx'; |
2 | import { Actions } from 'src/actions/lib/actions'; | 2 | import { Actions } from 'src/actions/lib/actions'; |
3 | import { ApiInterface } from 'src/api'; | 3 | import { ApiInterface } from 'src/api'; |
4 | import { Stores } from 'src/stores.types'; | 4 | import { Stores } from 'src/@types/stores.types'; |
5 | import Reaction from './Reaction'; | 5 | import Reaction from './Reaction'; |
6 | 6 | ||
7 | export default abstract class TypedStore { | 7 | export default abstract class TypedStore { |