lazyReplace<P> method
Replaces an existing registered dependency of type P with a new lazy factory builder.
If the existing instance is permanent, it will be forcefully deleted first.
tagOptional tag to identify the instance.fenixIf true, the builder callback will persist in memory to recreate the instance if deleted. If not provided, defaults to true if the parent instance was permanent.
Implementation
void lazyReplace<P>(
InstanceBuilderCallback<P> builder, {
String? tag,
bool? fenix,
}) {
final info = getInstanceInfo<P>(tag: tag);
final permanent = (info.isPermanent ?? false);
delete<P>(tag: tag, force: permanent);
lazyPut(builder, tag: tag, fenix: fenix ?? permanent);
}