diff options
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 3 | ||||
-rw-r--r-- | src/stores/FeaturesStore.js | 18 | ||||
-rw-r--r-- | src/stores/index.js | 2 |
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 @@ | |||
1 | import { action, computed, observable } from 'mobx'; | ||
2 | |||
3 | import Store from './lib/Store'; | ||
4 | import CachedRequest from './lib/CachedRequest'; | ||
5 | import Request from './lib/Request'; | ||
6 | |||
7 | export 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 @@ | |||
1 | import AppStore from './AppStore'; | 1 | import AppStore from './AppStore'; |
2 | import UserStore from './UserStore'; | 2 | import UserStore from './UserStore'; |
3 | import FeaturesStore from './FeaturesStore'; | ||
3 | import SettingsStore from './SettingsStore'; | 4 | import SettingsStore from './SettingsStore'; |
4 | import ServicesStore from './ServicesStore'; | 5 | import ServicesStore from './ServicesStore'; |
5 | import RecipesStore from './RecipesStore'; | 6 | import 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), |