lazyReplace<P> method
Replaces a parent instance with a new Instance
lazily from the
<P>builder()
callback.
tag
optional, if you use atag
to register the Instance.fenix
optional
Note: if fenix is not provided it will be set to true if the parent instance was permanent
Implementation
void lazyReplace<P>(InstanceBuilderCallback<P> builder,
{String? tag, bool? fenix}) {
final info = GetInstance().getInstanceInfo<P>(tag: tag);
final permanent = (info.isPermanent ?? false);
delete<P>(tag: tag, force: permanent);
lazyPut(builder, tag: tag, fenix: fenix ?? permanent);
}