refactor: optimize framework

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-06-21 12:30:30 +08:00
parent b6443f805d
commit dc46ab904a
7 changed files with 57 additions and 55 deletions

View File

@@ -2,11 +2,6 @@ import "reflect-metadata";
import { Container, inject, interfaces } from 'inversify';
import { autoProvide, provide, fluentProvide, buildProviderModule } from 'inversify-binding-decorators';
let container = new Container();
// Reflects all decorators provided by this package and packages them into
// a module to be loaded by the container
// container.load(buildProviderModule());
const provideNamed = (identifier: interfaces.ServiceIdentifier<any>, name: string) => {
return fluentProvide(identifier)
.whenTargetNamed(name)
@@ -19,4 +14,4 @@ const provideSingleton = (identifier: interfaces.ServiceIdentifier<any>) => {
.done();
};
export { container, autoProvide, provide, provideNamed, provideSingleton, inject, buildProviderModule };
export { autoProvide, provide, provideNamed, provideSingleton, inject, buildProviderModule };