UseInstance<T extends Object>.builder constructor
UseInstance<T extends Object>.builder (
- InstanceBuilder<
T> builder, [ - String? id
It's a ways to manage an instance, which registers a builder function and creates the instance, unless it has already done so.
When the dependency tree no longer needs it, it is completely deleted, including deregistration (deleting the builder function).
It uses less RAM than factory and singleton, but it consumes more CPU than the other modes.
Implementation
factory UseInstance.builder(InstanceBuilder<T> builder, [String? id]) =>
UseInstance.create(
builder,
id: id,
mode: InstanceManageMode.builder,
);