putOrFind<S> method

S putOrFind<S>(
  1. InstanceBuilderCallback<S> dep, {
  2. String? tag,
})

Implementation

S putOrFind<S>(InstanceBuilderCallback<S> dep, {String? tag}) {
  final key = _getKey(S, tag);

  if (_singl.containsKey(key)) {
    return _singl[key]!.getDependency() as S;
  } else {
    return put(dep(), tag: tag);
  }
}