From 76bf7b840ea7d607a21b0294d10be01b26ad0607 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 12 Apr 2019 15:51:57 +0200 Subject: merge-in latest develop --- src/stores/lib/Reaction.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/stores/lib') 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 @@ -// @flow import { autorun } from 'mobx'; export default class Reaction { @@ -15,14 +14,18 @@ export default class Reaction { start() { if (!this.isRunning) { this.dispose = autorun(() => this.reaction()); - this.isRunning = true; + this.isActive = true; } } stop() { if (this.isRunning) { this.dispose(); - this.isRunning = true; + this.isActive = false; } } } + +export const createReactions = reactions => ( + reactions.map(r => new Reaction(r)) +); -- cgit v1.2.3-54-g00ecf