cerebral-provider-modules
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -10,3 +10,3 @@ function ModulesProvider(context, execution, controller) { | ||
}, contextModules) | ||
module.meta = modules[key] | ||
module.meta = modules[key].meta | ||
module.state = context.state.select(modulePath) | ||
@@ -13,0 +13,0 @@ module.services = modulePath.reduce(function (services, key) { |
{ | ||
"name": "cerebral-provider-modules", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A modules provider for Cerebral", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# cerebral-provider-modules | ||
Modules pattern for Cerebral | ||
`npm install cerebral-provider-modules` | ||
```js | ||
import ModulesProvider from 'cerebral-provider-modules'; | ||
(controller || module).addContextProvider(ModulesProvider); | ||
``` | ||
```js | ||
function SomeAction({module, modules}) { | ||
module.state.set('foo', 'bar'); | ||
module.services.foo(); | ||
module.meta // {path,name, ...} | ||
modules.someOtherModule.meta // {path,name, ...} | ||
modules.someOtherModule.state('foo', 'bar'); | ||
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
2027
23