factory<T> method

void factory<T>(
  1. T factory(
    1. Container
    ), {
  2. String? name,
})

Registers a factory that will be executed every time resolve is called.

Implementation

void factory<T>(T Function(Container) factory, {String? name}) =>
  _factories[_key<T>(name)] = factory;