MCPcopy Create free account
hub / github.com/inversify/InversifyJS / DieselCarFactory

Class DieselCarFactory

src/test/inversify.test.ts:840–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838 }
839
840 @injectable()
841 class DieselCarFactory implements CarFactory {
842 private readonly _dieselFactory: (displacement: number) => Engine;
843 constructor(
844 @inject('Factory<Engine>')
845 factory: (category: string) => (displacement: number) => Engine,
846 ) {
847 this._dieselFactory = factory('diesel');
848 }
849 public createEngine(displacement: number): Engine {
850 return this._dieselFactory(displacement);
851 }
852 }
853
854 const container: Container = new Container();
855 container.bind<SparkPlugs>('SparkPlugs').to(SparkPlugs);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected