You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
es6-di/DependencyInjector.js

15 lines
323 B

const ServiceContainer = require('./ServiceContainer.js')
class DependencyInjector {
constructor() {
this.container = new ServiceContainer()
}
// Injects the dependencies into an uninstantiated class
make(Class) {
return Class.__inject(this.container)
}
}
module.exports = exports = DependencyInjector