replace<T> method

void replace<T>({
  1. required T instance,
  2. required PillarScope scope,
})

Implementation

void replace<T>({required T instance, required PillarScope scope}) {
  discard(scope);
  final PillarKey createdKey = _createKey<T>(null, null);
  _map[createdKey] = PillarEntry(
    key: createdKey,
    factory: _replacedFactory<T>,
    value: instance,
    instanceScope: scope,
  );
  _scopeChanges[scope]?.notify();
}