From 25d14af616d983929a79522e267349054de382fd Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 19 Oct 2017 12:00:03 +0100 Subject: [PATCH] Export a global.singletonFlairStore to allow cross-project singleton --- src/stores/FlairStore.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/stores/FlairStore.js b/src/stores/FlairStore.js index 11823f6761..ecb1bcd15c 100644 --- a/src/stores/FlairStore.js +++ b/src/stores/FlairStore.js @@ -147,8 +147,7 @@ class FlairStore extends EventEmitter { } } -let singletonFlairStore = null; -if (!singletonFlairStore) { - singletonFlairStore = new FlairStore(); +if (global.singletonFlairStore === undefined) { + global.singletonFlairStore = new FlairStore(); } -module.exports = singletonFlairStore; +export default global.singletonFlairStore;