diff options
author | 2019-03-28 16:23:17 +0100 | |
---|---|---|
committer | 2019-03-28 16:23:17 +0100 | |
commit | 7941831bf773b49944001c095a1949a1bdec2cf2 (patch) | |
tree | 5dbcbf097e340c381617410e032c2db6b811096e /src/features/utils/FeatureStore.js | |
parent | improve styling of workspace switch indicator (diff) | |
download | ferdium-app-7941831bf773b49944001c095a1949a1bdec2cf2.tar.gz ferdium-app-7941831bf773b49944001c095a1949a1bdec2cf2.tar.zst ferdium-app-7941831bf773b49944001c095a1949a1bdec2cf2.zip |
add workspace premium notice to dashboard
Diffstat (limited to 'src/features/utils/FeatureStore.js')
-rw-r--r-- | src/features/utils/FeatureStore.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/features/utils/FeatureStore.js b/src/features/utils/FeatureStore.js new file mode 100644 index 000000000..66b66a104 --- /dev/null +++ b/src/features/utils/FeatureStore.js | |||
@@ -0,0 +1,21 @@ | |||
1 | import Reaction from '../../stores/lib/Reaction'; | ||
2 | |||
3 | export class FeatureStore { | ||
4 | _actions = null; | ||
5 | |||
6 | _reactions = null; | ||
7 | |||
8 | _listenToActions(actions) { | ||
9 | if (this._actions) this._actions.forEach(a => a[0].off(a[1])); | ||
10 | this._actions = []; | ||
11 | actions.forEach(a => this._actions.push(a)); | ||
12 | this._actions.forEach(a => a[0].listen(a[1])); | ||
13 | } | ||
14 | |||
15 | _startReactions(reactions) { | ||
16 | if (this._reactions) this._reactions.forEach(r => r.stop()); | ||
17 | this._reactions = []; | ||
18 | reactions.forEach(r => this._reactions.push(new Reaction(r))); | ||
19 | this._reactions.forEach(r => r.start()); | ||
20 | } | ||
21 | } | ||