How to use the inversify.METADATA_KEY.TAGGED function in inversify

To help you get started, we’ve selected a few inversify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stkevintan / ServiceX / src / ioc / inject.ts View on Github external
const tagScope = (scope: ScopeType) => (target: any, key?: string, index?: number) => {
  if (typeof index !== 'number') {
    tagged(ScopeKeySymbol, scope)(target, key!, undefined)
    return
  }
  // 判重
  const metadata = Reflect.getMetadata(METADATA_KEY.TAGGED, target) || {}
  const taggedList = metadata[index] || []
  if (taggedList.every((tag: any) => tag.key !== ScopeKeySymbol)) {
    tagged(ScopeKeySymbol, scope)(target, undefined as any, index)
  }
}
const injectService = (service: any, target: any, key?: string, index?: number) => {
github vscode-icons / vscode-icons / src / services / compositionRootService.ts View on Github external
.forEach(klass => {
        Reflect.deleteMetadata(METADATA_KEY.PARAM_TYPES, klass);
        Reflect.deleteMetadata(METADATA_KEY.TAGGED, klass);
      });
  }