cerebral-provider-modules
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -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(); |
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
2154
26