##// END OF EJS Templates
working on IoC configuration
working on IoC configuration

File last commit:

r65:0c74a0572161 v1.2.13 default
r114:475b8ce3e850 ioc ts support
Show More
FactoryServiceDescriptor.ts
23 lines | 753 B | video/mp2t | TypeScriptLexer
/ src / main / ts / di / FactoryServiceDescriptor.ts
cin
changed the project structure
r49 import { ServiceDescriptor, ServiceDescriptorParams } from "./ServiceDescriptor";
import { Factory } from "../interfaces";
import { argumentNotNull, oid } from "../safe";
import { ActivationType } from "./interfaces";
export interface FactoryServiceDescriptorParams extends ServiceDescriptorParams {
factory: Factory;
}
export class FactoryServiceDescriptor extends ServiceDescriptor {
constructor(opts: FactoryServiceDescriptorParams) {
super(opts);
argumentNotNull(opts && opts.factory, "opts.factory");
// bind to null
cin
fixed "singleton" activation type handling in container configuration...
r65 this._factory = (...args) => opts.factory.apply(null, args);
cin
changed the project structure
r49
if (opts.activation === ActivationType.Singleton) {
this._cacheId = oid(opts.factory);
}
}
}