delete<T> static method

void delete<T>({
  1. String? name,
})

Removes a dependency from the container.

If the instance implements Disposable, its dispose method will be called automatically.

Implementation

static void delete<T>({String? name}) {
  final key = RxKey(T, name);

  final instance = _singletonMap[key];

  if (instance is Disposable) {
    instance.dispose();
  }

  _singletonMap.remove(key);
  _factoryMap.remove(key);
}