putOrFind<S> method

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

Registerd instance and if already exists then it will return

Implementation

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

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