diff options
Diffstat (limited to 'node_modules/sparkles/index.js')
-rw-r--r-- | node_modules/sparkles/index.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/node_modules/sparkles/index.js b/node_modules/sparkles/index.js index 1183745d5..e29363294 100644 --- a/node_modules/sparkles/index.js +++ b/node_modules/sparkles/index.js @@ -5,17 +5,17 @@ var EventEmitter = require('events').EventEmitter; var sparklesNamespace = 'store@sparkles'; var defaultNamespace = 'default'; -function getStore(){ +function getStore() { var store = global[sparklesNamespace]; - if(!store){ + if (!store) { store = global[sparklesNamespace] = {}; } return store; } -function getEmitter(namespace){ +function getEmitter(namespace) { var store = getStore(); @@ -23,10 +23,10 @@ function getEmitter(namespace){ var ee = store[namespace]; - if(!ee){ + if (!ee) { ee = store[namespace] = new EventEmitter(); ee.setMaxListeners(0); - ee.remove = function remove(){ + ee.remove = function remove() { ee.removeAllListeners(); delete store[namespace]; }; @@ -35,7 +35,7 @@ function getEmitter(namespace){ return ee; } -function exists(namespace){ +function exists(namespace) { var store = getStore(); return !!(store[namespace]); |