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

cerebral-provider-modules

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cerebral-provider-modules - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

8

index.js

@@ -5,3 +5,4 @@ function ModulesProvider(context, execution, controller) {

context.modules = Object.keys(modules).reduce(function (contextModules, key) {
var modulePath = key.split('.')
var modulePath = key.split('.');
var absModulePath = modules[key].path;
var module = modulePath.reduce(function (contextModules, pathKey) {

@@ -12,4 +13,5 @@ contextModules[pathKey] = contextModules[pathKey] || {}

module.meta = modules[key].meta
module.state = context.state.select(modulePath)
module.services = modulePath.reduce(function (services, key) {
module.path = absModulePath;
module.state = context.state.select(absModulePath)
module.services = absModulePath.reduce(function (services, key) {
return services[key] || {}

@@ -16,0 +18,0 @@ }, services)

{
"name": "cerebral-provider-modules",
"version": "0.1.1",
"version": "0.1.2",
"description": "A modules provider for Cerebral",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,7 +14,7 @@ # cerebral-provider-modules

function SomeAction({module, modules}) {
module.meta // returned value from module declaration
module.state.set('foo', 'bar');
module.services.foo();
module.meta // {path,name, ...}
modules.someOtherModule.meta // {path,name, ...}
modules.someOtherModule.meta // returned value from module declaration
modules.someOtherModule.state('foo', 'bar');

@@ -21,0 +21,0 @@ modules.someOtherModule.services.foo();

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