blob: 42823e74cc05303fd813d9bda2e444e093d8bcfe (
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
32
33
34
35
36
|
import { reaction } from 'mobx';
import { AnnouncementsStore } from './store';
const debug = require('debug')('Ferdi:feature:announcements');
export const GA_CATEGORY_ANNOUNCEMENTS = 'Announcements';
export const announcementsStore = new AnnouncementsStore();
export const ANNOUNCEMENTS_ROUTES = {
TARGET: '/announcements/:id',
};
export default function initAnnouncements(stores, actions) {
// const { features } = stores;
// Toggle workspace feature
reaction(
() => (
true
// features.features.isAnnouncementsEnabled
),
(isEnabled) => {
if (isEnabled) {
debug('Initializing `announcements` feature');
announcementsStore.start(stores, actions);
} else if (announcementsStore.isFeatureActive) {
debug('Disabling `announcements` feature');
announcementsStore.stop();
}
},
{
fireImmediately: true,
},
);
}
|