aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/index.ts')
-rw-r--r--src/stores/index.ts45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/stores/index.ts b/src/stores/index.ts
new file mode 100644
index 000000000..e980f2c5b
--- /dev/null
+++ b/src/stores/index.ts
@@ -0,0 +1,45 @@
1import AppStore from './AppStore';
2import UserStore from './UserStore';
3import FeaturesStore from './FeaturesStore';
4import SettingsStore from './SettingsStore';
5import ServicesStore from './ServicesStore';
6import RecipesStore from './RecipesStore';
7import RecipePreviewsStore from './RecipePreviewsStore';
8import UIStore from './UIStore';
9import NewsStore from './NewsStore';
10import RequestStore from './RequestStore';
11import GlobalErrorStore from './GlobalErrorStore';
12import { workspaceStore } from '../features/workspaces';
13import { announcementsStore } from '../features/announcements';
14import { communityRecipesStore } from '../features/communityRecipes';
15import { todosStore } from '../features/todos';
16
17export default (api, actions, router) => {
18 const stores = {};
19 Object.assign(stores, {
20 router,
21 app: new AppStore(stores, api, actions),
22 user: new UserStore(stores, api, actions),
23 features: new FeaturesStore(stores, api, actions),
24 settings: new SettingsStore(stores, api, actions),
25 services: new ServicesStore(stores, api, actions),
26 recipes: new RecipesStore(stores, api, actions),
27 recipePreviews: new RecipePreviewsStore(stores, api, actions),
28 ui: new UIStore(stores, api, actions),
29 news: new NewsStore(stores, api, actions),
30 requests: new RequestStore(stores, api, actions),
31 globalError: new GlobalErrorStore(stores, api, actions),
32 workspaces: workspaceStore,
33 announcements: announcementsStore,
34 communityRecipes: communityRecipesStore,
35 todos: todosStore,
36 });
37
38 // Initialize all stores
39 Object.keys(stores).forEach((name) => {
40 if (stores[name] && stores[name].initialize) {
41 stores[name].initialize();
42 }
43 });
44 return stores;
45};