copyUpdateOnThen<A2> method
Returns a copy of this observer with a replaced onThen callback and
a new value type A2.
All other callbacks are inherited from this observer unchanged.
onThen: The new then callback.
Implementation
ContObserver<F, A2> copyUpdateOnThen<A2>(
void Function(A2 value) onThen,
) {
return switch (this) {
SafeObserver<F, A>(
isUsed: final isUsed,
_onUnsafePanic: final _onUnsafePanic,
onElse: final onElse,
onCrash: final onCrash,
) =>
SafeObserver._(
isUsed,
_onUnsafePanic,
onCrash,
onElse,
onThen,
),
_UnsafeObserver<F, A>(
_onUnsafePanic: final _onUnsafePanic,
onElse: final onElse,
onCrash: final onCrash,
) =>
_UnsafeObserver._(
_onUnsafePanic,
onCrash,
onElse,
onThen,
),
};
}