@ghostmonitor/recart-di-loader

Loads local and remote dependencies in Recart's dependency injection system

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@ghostmonitor/recart-di-loader
7.6.14 years ago4 years agoMinified + gzip package size for @ghostmonitor/recart-di-loader in KB

Readme

Greenkeeper badge
  • Loads dependency injectable modules from /services directory
  • A module must return with a constructor that has a dependencies property
module.exports = function(dep1, dep2) {
  // body of singleton service
}
module.exports.dependencies = ['dep1', 'dep2']
``` 
- If a dependency doesn't exist in `/services` that it tries to load the `@ghostmonitor/recart-di-<depname>` npm package.
 

#Usage
services/index.js:
```javascript
const Bottle = require('bottlejs')
const di = new Bottle()
const loader = require('@ghostmonitor/recart-di-loader')
loader.loadLocalServices(di)

module.exports = di.container