( constructor: ConstructorOf<T>, scope: ScopeConfig['scope'] = SingletonScope, )
| 12 | export const SingletonScope = Symbol('scope:singleton') |
| 13 | |
| 14 | export function getInstanceWithScope<T>( |
| 15 | constructor: ConstructorOf<T>, |
| 16 | scope: ScopeConfig['scope'] = SingletonScope, |
| 17 | ): T { |
| 18 | switch (scope) { |
| 19 | case SingletonScope: |
| 20 | return InjectableFactory.getInstance(constructor) |
| 21 | case TransientScope: |
| 22 | return InjectableFactory.initialize(constructor) |
| 23 | default: |
| 24 | return createOrGetInstanceInScope(constructor, scope) |
| 25 | } |
| 26 | } |
no test coverage detected