Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hadron-app-registry

Package Overview
Dependencies
Maintainers
26
Versions
524
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hadron-app-registry - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

64

lib/app-registry.js
'use strict';
const Reflux = require('reflux');
const EventEmitter = require('events');
const Action = require('./actions');

@@ -23,22 +24,5 @@

*/
class AppRegistry {
class AppRegistry extends EventEmitter {
/**
* Executes the provided function against all stores in the registry.
*
* @param {Function} fn - The function
*
* @returns {AppRegistry} This instance.
*/
callOnStores(fn) {
for (let key in this.stores) {
if (this.stores.hasOwnProperty(key)) {
const store = this.stores[key];
fn(store);
}
}
return this;
}
/**
* Instantiate the registry.

@@ -49,2 +33,3 @@ *

constructor() {
super();
this.actions = {};

@@ -193,3 +178,3 @@ this.components = {};

onActivated() {
return this.callOnStores((store) => {
return this._callOnStores((store) => {
if (store.onActivated) {

@@ -202,33 +187,2 @@ store.onActivated(this);

/**
* Calls onConnected on all the stores in the registry.
*
* @param {Error} error - The possible error.
* @param {DataService} dataService - The connected data service.
*
* @returns {AppRegistry} The app registry.
*/
onConnected(error, dataService) {
return this.callOnStores((store) => {
if (store.onConnected) {
store.onConnected(error, dataService);
}
});
}
/**
* Calls onDataServiceInitialized on all the stores in the registry.
*
* @param {DataService} dataService - The data service before connection.
*
* @returns {AppRegistry} The app registry.
*/
onDataServiceInitialized(dataService) {
return this.callOnStores((store) => {
if (store.onDataServiceInitialized) {
store.onDataServiceInitialized(dataService);
}
});
}
/**
* Register an action in the registry.

@@ -327,2 +281,12 @@ *

_callOnStores(fn) {
for (let key in this.stores) {
if (this.stores.hasOwnProperty(key)) {
const store = this.stores[key];
fn(store);
}
}
return this;
}
_roleComparator(a, b) {

@@ -329,0 +293,0 @@ const aOrder = a.order || INT8_MAX;

@@ -7,3 +7,3 @@ {

"homepage": "https://github.com/mongodb-js/hadron-app-registry",
"version": "6.0.0",
"version": "7.0.0",
"repository": {

@@ -10,0 +10,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc