aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar haraldox <hnaumann+github@gmail.com>2018-02-26 11:52:11 +0100
committerLibravatar haraldox <hnaumann+github@gmail.com>2018-02-26 11:52:11 +0100
commit31820727240772a049c6af71742baa8e50039cda (patch)
tree3647701f523ebdf0cd3d9bbdb88574a7b3d8081d /src/stores
parentMerge pull request #721 from meetfranz/i18n (diff)
downloadferdium-app-31820727240772a049c6af71742baa8e50039cda.tar.gz
ferdium-app-31820727240772a049c6af71742baa8e50039cda.tar.zst
ferdium-app-31820727240772a049c6af71742baa8e50039cda.zip
initial commit
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/AppStore.js3
-rw-r--r--src/stores/FeaturesStore.js18
-rw-r--r--src/stores/index.js2
3 files changed, 23 insertions, 0 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 162422017..a5640e8d3 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -158,6 +158,9 @@ export default class AppStore extends Store {
158 this.locale = this._getDefaultLocale(); 158 this.locale = this._getDefaultLocale();
159 159
160 this._healthCheck(); 160 this._healthCheck();
161
162 const defaults = this.stores.features.defaults;
163 console.log(defaults)
161 } 164 }
162 165
163 @computed get cacheSize() { 166 @computed get cacheSize() {
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js
new file mode 100644
index 000000000..5f738557f
--- /dev/null
+++ b/src/stores/FeaturesStore.js
@@ -0,0 +1,18 @@
1import { action, computed, observable } from 'mobx';
2
3import Store from './lib/Store';
4import CachedRequest from './lib/CachedRequest';
5import Request from './lib/Request';
6
7export default class RecipesStore extends Store {
8 @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'defaults');
9
10 setup() {
11 return this.defaults;
12 }
13
14 @computed get defaults() {
15 console.log('GETTING DEFAULTS')
16 return this.defaultFeaturesRequest.execute().result || [];
17 }
18}
diff --git a/src/stores/index.js b/src/stores/index.js
index 2d99e3952..96b844c95 100644
--- a/src/stores/index.js
+++ b/src/stores/index.js
@@ -1,5 +1,6 @@
1import AppStore from './AppStore'; 1import AppStore from './AppStore';
2import UserStore from './UserStore'; 2import UserStore from './UserStore';
3import FeaturesStore from './FeaturesStore';
3import SettingsStore from './SettingsStore'; 4import SettingsStore from './SettingsStore';
4import ServicesStore from './ServicesStore'; 5import ServicesStore from './ServicesStore';
5import RecipesStore from './RecipesStore'; 6import RecipesStore from './RecipesStore';
@@ -16,6 +17,7 @@ export default (api, actions, router) => {
16 router, 17 router,
17 app: new AppStore(stores, api, actions), 18 app: new AppStore(stores, api, actions),
18 user: new UserStore(stores, api, actions), 19 user: new UserStore(stores, api, actions),
20 features: new FeaturesStore(stores, api, actions),
19 settings: new SettingsStore(stores, api, actions), 21 settings: new SettingsStore(stores, api, actions),
20 services: new ServicesStore(stores, api, actions), 22 services: new ServicesStore(stores, api, actions),
21 recipes: new RecipesStore(stores, api, actions), 23 recipes: new RecipesStore(stores, api, actions),