put<S> method

S put<S>(
  1. S dependencyBuilder(), {
  2. String? tag,
  3. bool permanent = true,
})

Holds a reference to every registered callback when using June.lazyPut()

Implementation

// static final Map<String, _Lazy> _factory = {};

// void injector<S>(
//   InjectorBuilderCallback<S> fn, {
//   String? tag,
//   bool fenix = false,
//   //  bool permanent = false,
// }) {
//   lazyPut(
//     () => fn(this),
//     tag: tag,
//     fenix: fenix,
//     // permanent: permanent,
//   );
// }

S put<S>(
    S Function() dependencyBuilder, {
  String? tag,
  bool permanent = true,
}) {
  _insert(
      isSingleton: true,
      name: tag,
      permanent: permanent,
      builder: (dependencyBuilder));
  return find<S>(tag: tag);
}