putLazy<T> method
Register a lazy factory
Creates singleton on first access (default behavior).
Set isPermanent to true to survive scope cleanup.
Set alwaysNew to true to create fresh instance on each find().
Implementation
void putLazy<T>(
T Function() factory, {
String? tag,
bool isPermanent = false,
bool alwaysNew = false,
}) {
_scope.putLazy<T>(
factory,
tag: tag,
isPermanent: isPermanent,
alwaysNew: alwaysNew,
);
final behavior = alwaysNew
? 'factory (always new)'
: (isPermanent ? 'permanent' : 'temporary');
ZenLogger.logDebug('Registered lazy $behavior for $T in test container');
}