blob: 4d45c3b331c9d99be3b950285d8ccadb6dd63d10 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import { computed, observable } from 'mobx';
import { FeatureStore } from '../utils/FeatureStore';
const debug = require('debug')('Franz:feature:communityRecipes:store');
export class CommunityRecipesStore extends FeatureStore {
@observable isCommunityRecipesIncludedInCurrentPlan = false;
start(stores, actions) {
debug('start');
this.stores = stores;
this.actions = actions;
}
stop() {
debug('stop');
super.stop();
}
@computed get communityRecipes() {
if (!this.stores) return [];
return this.stores.recipePreviews.dev.map((r) => {
r.isDevRecipe = !!r.author.find(a => a.email === this.stores.user.data.email);
return r;
});
}
}
export default CommunityRecipesStore;
|