A factory function that creates a service instance, optionally resolving other services from the provided ServiceProvider.
The type of the service instance the factory creates.
const loggerFactory: ServiceFactory<Logger> = (provider) => { const config = provider.get(IConfig); return new Logger(config.logLevel);}; Copy
const loggerFactory: ServiceFactory<Logger> = (provider) => { const config = provider.get(IConfig); return new Logger(config.logLevel);};
ServiceCollection
A factory function that creates a service instance, optionally resolving other services from the provided ServiceProvider.