Provider that uses a factory function with auto-injection support
Note: Factory providers do not support scope/lifecycle in tsyringe. Factories are always called fresh on each resolution (transient-like behavior).
{ provide: LOGGER_TOKENS.Transports, useFactory: (console) => [console], inject: [LOGGER_TOKENS.ConsoleTransport]} Copy
{ provide: LOGGER_TOKENS.Transports, useFactory: (console) => [console], inject: [LOGGER_TOKENS.ConsoleTransport]}
Optional
Provider that uses a factory function with auto-injection support
Note: Factory providers do not support scope/lifecycle in tsyringe. Factories are always called fresh on each resolution (transient-like behavior).
Example: Factory with dependencies