diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-10-13 12:29:40 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2017-10-13 12:29:40 +0200 |
commit | 58cda9cc7fb79ca9df6746de7f9662bc08dc156a (patch) | |
tree | 1211600c2a5d3b5f81c435c6896618111a611720 /src/stores/index.js | |
download | ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.tar.gz ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.tar.zst ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.zip |
initial commit
Diffstat (limited to 'src/stores/index.js')
-rw-r--r-- | src/stores/index.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/stores/index.js b/src/stores/index.js new file mode 100644 index 000000000..2d99e3952 --- /dev/null +++ b/src/stores/index.js | |||
@@ -0,0 +1,34 @@ | |||
1 | import AppStore from './AppStore'; | ||
2 | import UserStore from './UserStore'; | ||
3 | import SettingsStore from './SettingsStore'; | ||
4 | import ServicesStore from './ServicesStore'; | ||
5 | import RecipesStore from './RecipesStore'; | ||
6 | import RecipePreviewsStore from './RecipePreviewsStore'; | ||
7 | import UIStore from './UIStore'; | ||
8 | import PaymentStore from './PaymentStore'; | ||
9 | import NewsStore from './NewsStore'; | ||
10 | import RequestStore from './RequestStore'; | ||
11 | import GlobalErrorStore from './GlobalErrorStore'; | ||
12 | |||
13 | export default (api, actions, router) => { | ||
14 | const stores = {}; | ||
15 | Object.assign(stores, { | ||
16 | router, | ||
17 | app: new AppStore(stores, api, actions), | ||
18 | user: new UserStore(stores, api, actions), | ||
19 | settings: new SettingsStore(stores, api, actions), | ||
20 | services: new ServicesStore(stores, api, actions), | ||
21 | recipes: new RecipesStore(stores, api, actions), | ||
22 | recipePreviews: new RecipePreviewsStore(stores, api, actions), | ||
23 | ui: new UIStore(stores, api, actions), | ||
24 | payment: new PaymentStore(stores, api, actions), | ||
25 | news: new NewsStore(stores, api, actions), | ||
26 | requests: new RequestStore(stores, api, actions), | ||
27 | globalError: new GlobalErrorStore(stores, api, actions), | ||
28 | }); | ||
29 | // Initialize all stores | ||
30 | Object.keys(stores).forEach((name) => { | ||
31 | if (stores[name] && stores[name].initialize) stores[name].initialize(); | ||
32 | }); | ||
33 | return stores; | ||
34 | }; | ||