##// END OF EJS Templates
added provided and configure methods to the fluent container configuration, added applyConfig method to the container
added provided and configure methods to the fluent container configuration, added applyConfig method to the container

File last commit:

r129:c13384c6c1ac ioc ts support
r142:be7edf08a115 v1.4.0-rc3 default
Show More
FactoryServiceDescriptor.ts
18 lines | 668 B | video/mp2t | TypeScriptLexer
/ src / main / ts / di / FactoryServiceDescriptor.ts
import { ServiceDescriptor, ServiceDescriptorParams } from "./ServiceDescriptor";
import { argumentNotNull, oid } from "../safe";
export interface FactoryServiceDescriptorParams<S extends object, T, P extends any[]> extends ServiceDescriptorParams<S, T, P> {
factory: (...args: P) => T;
}
export class FactoryServiceDescriptor<S extends object, T, P extends any[]> extends ServiceDescriptor<S, T, P> {
constructor(opts: FactoryServiceDescriptorParams<S, T, P>) {
super(opts);
argumentNotNull(opts && opts.factory, "opts.factory");
// bind to null
this._factory = (...args) => opts.factory.apply(null, args as any);
}
}