hadron-app-registry
Advanced tools
Comparing version 5.3.0 to 6.0.0
'use strict'; | ||
const Reflux = require('reflux'); | ||
const Action = require('./actions'); | ||
@@ -13,2 +14,8 @@ | ||
/** | ||
* Returning a fake store when asking for a store that does not | ||
* exist. | ||
*/ | ||
const STUB_STORE = Reflux.createStore(); | ||
/** | ||
* Is a registry for all user interface components, stores, and actions | ||
@@ -47,2 +54,3 @@ * in the application. | ||
this.roles = {}; | ||
this.storeMisses = {}; | ||
} | ||
@@ -171,3 +179,8 @@ | ||
getStore(name) { | ||
return this.stores[name]; | ||
const store = this.stores[name]; | ||
if (store === undefined) { | ||
this.storeMisses[name] = (this.storeMisses[name] || 0) + 1; | ||
return STUB_STORE; | ||
} | ||
return store; | ||
} | ||
@@ -174,0 +187,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"homepage": "https://github.com/mongodb-js/hadron-app-registry", | ||
"version": "5.3.0", | ||
"version": "6.0.0", | ||
"repository": { | ||
@@ -10,0 +10,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24806
494