summaryrefslogtreecommitdiffstats
path: root/src/features/planSelection/index.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-10-24 15:55:22 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2019-10-24 15:55:22 +0200
commitbacb5b940333f7e3af9f9d978d1d72c75f1aa321 (patch)
tree50c8ecb3d08e997106e48d1de5b904a2dba30991 /src/features/planSelection/index.js
parentMerge translations (diff)
parentSwitch to beta version (diff)
downloadferdium-app-bacb5b940333f7e3af9f9d978d1d72c75f1aa321.tar.gz
ferdium-app-bacb5b940333f7e3af9f9d978d1d72c75f1aa321.tar.zst
ferdium-app-bacb5b940333f7e3af9f9d978d1d72c75f1aa321.zip
Merge branch 'develop' into l10n_develop
Diffstat (limited to 'src/features/planSelection/index.js')
-rw-r--r--src/features/planSelection/index.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/features/planSelection/index.js b/src/features/planSelection/index.js
new file mode 100644
index 000000000..890be8871
--- /dev/null
+++ b/src/features/planSelection/index.js
@@ -0,0 +1,28 @@
1import { reaction } from 'mobx';
2import PlanSelectionStore from './store';
3
4const debug = require('debug')('Franz:feature:planSelection');
5
6export const planSelectionStore = new PlanSelectionStore();
7
8export default function initPlanSelection(stores, actions) {
9 stores.planSelection = planSelectionStore;
10 const { features } = stores;
11
12 // Toggle planSelection feature
13 reaction(
14 () => features.features.isPlanSelectionEnabled,
15 (isEnabled) => {
16 if (isEnabled) {
17 debug('Initializing `planSelection` feature');
18 planSelectionStore.start(stores, actions);
19 } else if (planSelectionStore.isFeatureActive) {
20 debug('Disabling `planSelection` feature');
21 planSelectionStore.stop();
22 }
23 },
24 {
25 fireImmediately: true,
26 },
27 );
28}