flatMap<R> method

ProgressDialogResult<R> flatMap<R>(
  1. ProgressDialogResult<R> fn(
    1. T value
    )
)

Chains results by applying the provided function to success values

Implementation

ProgressDialogResult<R> flatMap<R>(ProgressDialogResult<R> Function(T value) fn) {
  return switch (this) {
    Success(:final value) => fn(value),
    Failure(:final error, :final stackTrace) => Failure(error, stackTrace),
  };
}