aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/communityRecipes/index.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-05-02 11:27:23 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-05-02 11:27:23 +0200
commitfbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e (patch)
treedfa0a6c32ce62c605bcdbf5538d9dc03725d1f88 /src/features/communityRecipes/index.js
parentUpdate CHANGELOG.md (diff)
downloadferdium-app-fbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e.tar.gz
ferdium-app-fbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e.tar.zst
ferdium-app-fbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e.zip
Add custom recipe limitation
Diffstat (limited to 'src/features/communityRecipes/index.js')
-rw-r--r--src/features/communityRecipes/index.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/features/communityRecipes/index.js b/src/features/communityRecipes/index.js
new file mode 100644
index 000000000..78e87855e
--- /dev/null
+++ b/src/features/communityRecipes/index.js
@@ -0,0 +1,28 @@
1import { reaction } from 'mobx';
2import { CommunityRecipesStore } from './store';
3
4const debug = require('debug')('Franz:feature:communityRecipes');
5
6export const DEFAULT_SERVICE_LIMIT = 3;
7
8export const communityRecipesStore = new CommunityRecipesStore();
9
10export default function initCommunityRecipes(stores, actions) {
11 const { features } = stores;
12
13 communityRecipesStore.start(stores, actions);
14
15 // Toggle communityRecipe premium status
16 reaction(
17 () => (
18 features.features.isCommunityRecipesPremiumFeature
19 ),
20 (isPremiumFeature) => {
21 debug('Community recipes is premium feature: ', isPremiumFeature);
22 communityRecipesStore.isCommunityRecipesPremiumFeature = isPremiumFeature;
23 },
24 {
25 fireImmediately: true,
26 },
27 );
28}