registerFactory<T> static method
void
registerFactory<T>(
- T factory()
Registers a factory function that creates an instance of type T.
The factory is executed when get<T>() is called for the first time.
Implementation
static void registerFactory<T>(T Function() factory) {
_instances[T] = factory;
}