diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-04-13 20:58:37 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-04-13 20:58:37 +0200 |
commit | 8e623e84cf21068561217a509c0761d524dfbc29 (patch) | |
tree | a83f307c3ce087169e3a1d55418fa78a71b7b4dc /src/features/announcements/index.js | |
parent | Use store reactions (diff) | |
parent | Merge branch 'feature/announcements' into develop (diff) | |
download | ferdium-app-8e623e84cf21068561217a509c0761d524dfbc29.tar.gz ferdium-app-8e623e84cf21068561217a509c0761d524dfbc29.tar.zst ferdium-app-8e623e84cf21068561217a509c0761d524dfbc29.zip |
Merge branch 'develop' into chore/streamline-dashboard
Diffstat (limited to 'src/features/announcements/index.js')
-rw-r--r-- | src/features/announcements/index.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/features/announcements/index.js b/src/features/announcements/index.js new file mode 100644 index 000000000..c087689a7 --- /dev/null +++ b/src/features/announcements/index.js | |||
@@ -0,0 +1,30 @@ | |||
1 | import { reaction } from 'mobx'; | ||
2 | import { AnnouncementsStore } from './store'; | ||
3 | |||
4 | const debug = require('debug')('Franz:feature:announcements'); | ||
5 | |||
6 | export const announcementsStore = new AnnouncementsStore(); | ||
7 | |||
8 | export default function initAnnouncements(stores, actions) { | ||
9 | // const { features } = stores; | ||
10 | |||
11 | // Toggle workspace feature | ||
12 | reaction( | ||
13 | () => ( | ||
14 | true | ||
15 | // features.features.isAnnouncementsEnabled | ||
16 | ), | ||
17 | (isEnabled) => { | ||
18 | if (isEnabled) { | ||
19 | debug('Initializing `announcements` feature'); | ||
20 | announcementsStore.start(stores, actions); | ||
21 | } else if (announcementsStore.isFeatureActive) { | ||
22 | debug('Disabling `announcements` feature'); | ||
23 | announcementsStore.stop(); | ||
24 | } | ||
25 | }, | ||
26 | { | ||
27 | fireImmediately: true, | ||
28 | }, | ||
29 | ); | ||
30 | } | ||