remove<T> method

T? remove<T>({
  1. String? tag,
})

removes an instance from the hasmap

Implementation

T? remove<T>({String? tag}) {
  final key = _getKey(T, tag);
  final _singleton = _vars.remove(key) as Singleton<T>?;
  if (_singleton?.onRemove != null) {
    _singleton!.onRemove!(
      _singleton.dependency,
    );
  }
  return _singleton?.dependency;
}