put<S> method

S put<S>(
  1. S dependency, {
  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 dependency, {
  String? tag,
  bool permanent = true,
}) {
  _insert(
      isSingleton: true,
      name: tag,
      permanent: permanent,
      builder: (() => dependency));
  return find<S>(tag: tag);
}