diff --git a/.vscode/settings.json b/.vscode/settings.json index 9fcf0dc..05be469 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "bumpp", "Containerable", "Fastly", + "inversify", "Naily", "nailyjs", "paramtypes", diff --git a/packages/ioc/src/index.ts b/packages/ioc/src/index.ts index 5021157..32100eb 100644 --- a/packages/ioc/src/index.ts +++ b/packages/ioc/src/index.ts @@ -3,6 +3,22 @@ * This is the core package of naily, which provides the basic IOC features. It is a lightweight、across-platform and easy-to-use IOC meta framework for TypeScript. * * @module + * @example + * ```typescript + * import { Container, Injectable, Inject } from '@nailyjs/ioc' + * + * Injectable() + * export class FooService {} + * + * Injectable() + * export class BarService { + * constructor(private fooService: FooService) {} + * } + * + * // No similar inversify.js, container will automatically inspect the dependencies of the constructors. + * const container = new Container() + * console.log(container.getContainer()) // It is a Map object, which contains all the registered services. + * ``` */ export * from './apply-decorator'