addSingleton<T> method
Add a singleton factory to the container. The container will only call this once throughout the lifespan of the app
Implementation
void addSingleton<T>(
T Function(
IocContainer container,
)
factory,
) =>
addServiceDefinition<T>(
ServiceDefinition<T>(
(container) => factory(container),
isSingleton: true,
),
);