Init: Create & Init ms Project...
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
23
packages/container/src/index.ts
Normal file
23
packages/container/src/index.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import "reflect-metadata";
|
||||
import { interfaces, Container } from 'inversify';
|
||||
import { fluentProvide } from 'inversify-binding-decorators';
|
||||
|
||||
const provideNamed = (identifier: interfaces.ServiceIdentifier<any>, name: string) => {
|
||||
return fluentProvide(identifier).whenTargetNamed(name).done();
|
||||
};
|
||||
|
||||
const provideSingleton = (identifier: interfaces.ServiceIdentifier<any>) => {
|
||||
return fluentProvide(identifier).inSingletonScope().done();
|
||||
};
|
||||
|
||||
const DefaultContainer = new Container();
|
||||
|
||||
export * from 'inversify'
|
||||
export * from './decorators'
|
||||
export * from 'inversify-binding-decorators'
|
||||
export {
|
||||
fluentProvide,
|
||||
provideNamed,
|
||||
provideSingleton,
|
||||
DefaultContainer
|
||||
};
|
Reference in New Issue
Block a user