aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/lib
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-12 15:51:57 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-12 15:52:55 +0200
commit76bf7b840ea7d607a21b0294d10be01b26ad0607 (patch)
tree05b15350fa8cf00972ae8caab812868b9fa9dfe0 /src/stores/lib
parentalign announcement and spotlight (diff)
downloadferdium-app-76bf7b840ea7d607a21b0294d10be01b26ad0607.tar.gz
ferdium-app-76bf7b840ea7d607a21b0294d10be01b26ad0607.tar.zst
ferdium-app-76bf7b840ea7d607a21b0294d10be01b26ad0607.zip
merge-in latest develop
Diffstat (limited to 'src/stores/lib')
-rw-r--r--src/stores/lib/Reaction.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/stores/lib/Reaction.js b/src/stores/lib/Reaction.js
index b123ec01c..f2642908f 100644
--- a/src/stores/lib/Reaction.js
+++ b/src/stores/lib/Reaction.js
@@ -1,4 +1,3 @@
1// @flow
2import { autorun } from 'mobx'; 1import { autorun } from 'mobx';
3 2
4export default class Reaction { 3export default class Reaction {
@@ -15,14 +14,18 @@ export default class Reaction {
15 start() { 14 start() {
16 if (!this.isRunning) { 15 if (!this.isRunning) {
17 this.dispose = autorun(() => this.reaction()); 16 this.dispose = autorun(() => this.reaction());
18 this.isRunning = true; 17 this.isActive = true;
19 } 18 }
20 } 19 }
21 20
22 stop() { 21 stop() {
23 if (this.isRunning) { 22 if (this.isRunning) {
24 this.dispose(); 23 this.dispose();
25 this.isRunning = true; 24 this.isActive = false;
26 } 25 }
27 } 26 }
28} 27}
28
29export const createReactions = reactions => (
30 reactions.map(r => new Reaction(r))
31);