A constructor that produces the desired resource
Rest
...args: Target<K, G>Rest
...deps: KA list of dependencies that resolve to ctor's arguments
Providing a default injection for a class:
class User {
name: string; id: number
constructor(name: string, id: number) {
this.name = name; this.id = id
}
static inject = Inject.construct(this, NameKey, IdKey)
}
Generated using TypeDoc
Equivalent to
Inject.map([...deps], args => new ctor(...args))
.