import { type FactoryProvider } from "https://deno.land/x/oak_nest@v1.14.1/mod.ts";
Interface defining a Factory type provider.
For example:
const connectionFactory = {
provide: 'CONNECTION',
useFactory: (optionsProvider: OptionsProvider) => {
const options = optionsProvider.get();
return new DatabaseConnection(options);
},
inject: [OptionsProvider],
};
Properties
useFactory: (...args: any[]) => T
Factory function that returns an instance of the provider to be injected.
Optional list of providers to be injected into the context of the Factory function.