aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/planSelection/index.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-10-24 15:15:42 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2019-10-24 15:15:42 +0200
commit54f8b191a94bd78a85b046bbf21dd2245d3a6f3e (patch)
treeada5876f0e8a697ba4693bba07f5e0f31fea1fc9 /src/features/planSelection/index.js
parentUpdate submodules (diff)
parentbump version to 5.4.0 (diff)
downloadferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.tar.gz
ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.tar.zst
ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.zip
Merge https://github.com/meetfranz/franz into franz-5.4.0-release
Diffstat (limited to 'src/features/planSelection/index.js')
-rw-r--r--src/features/planSelection/index.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/features/planSelection/index.js b/src/features/planSelection/index.js
new file mode 100644
index 000000000..81189207a
--- /dev/null
+++ b/src/features/planSelection/index.js
@@ -0,0 +1,30 @@
1import { reaction } from 'mobx';
2import PlanSelectionStore from './store';
3
4const debug = require('debug')('Franz:feature:planSelection');
5
6export const GA_CATEGORY_PLAN_SELECTION = 'planSelection';
7
8export const planSelectionStore = new PlanSelectionStore();
9
10export default function initPlanSelection(stores, actions) {
11 stores.planSelection = planSelectionStore;
12 const { features } = stores;
13
14 // Toggle planSelection feature
15 reaction(
16 () => features.features.isPlanSelectionEnabled,
17 (isEnabled) => {
18 if (isEnabled) {
19 debug('Initializing `planSelection` feature');
20 planSelectionStore.start(stores, actions);
21 } else if (planSelectionStore.isFeatureActive) {
22 debug('Disabling `planSelection` feature');
23 planSelectionStore.stop();
24 }
25 },
26 {
27 fireImmediately: true,
28 },
29 );
30}