Start routing and pipeline rewrite
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
11
src/di/constructable.ts
Normal file
11
src/di/constructable.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import {Container} from './Container'
|
||||
import {TypedDependencyKey} from './types'
|
||||
import {Pipeline} from '../util'
|
||||
|
||||
export type Constructable<T> = Pipeline<Container, T>
|
||||
|
||||
export function constructable<T>(key: TypedDependencyKey<T>): Constructable<T> {
|
||||
return new Pipeline<Container, T>(
|
||||
container => container.make(key),
|
||||
)
|
||||
}
|
||||
@@ -14,3 +14,4 @@ export * from './types'
|
||||
|
||||
export * from './decorator/injection'
|
||||
export * from './InjectionAware'
|
||||
export * from './constructable'
|
||||
|
||||
Reference in New Issue
Block a user