12 lines
340 B
TypeScript
12 lines
340 B
TypeScript
|
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),
|
||
|
)
|
||
|
}
|