@ghostmonitor/recart-di-loader
v7.6.1
Published
Loads local and remote dependencies in Recart's dependency injection system
Readme
- Loads dependency injectable modules from
/servicesdirectory - A module must return with a constructor that has a
dependenciesproperty
module.exports = function(dep1, dep2) {
// body of singleton service
}
module.exports.dependencies = ['dep1', 'dep2']- If a dependency doesn't exist in
/servicesthat it tries to load the@ghostmonitor/recart-di-<depname>npm package.
#Usage services/index.js:
const Bottle = require('bottlejs')
const di = new Bottle()
const loader = require('@ghostmonitor/recart-di-loader')
loader.loadLocalServices(di)
module.exports = di.container