flatMap<R> method

  1. @override
Failure<R> flatMap<R>(
  1. R onSuccess(
    1. T value
    ), {
  2. ExceptionHandler? exceptionHandler,
  3. String? errorGroup,
})
override

Maps a Result<T> to Result<R> using the provided function. If the original result is a failure, the same error is retained.

onSuccess is the function that transforms the value if the result is a success. exceptionHandler is an optional handler for any exceptions thrown during the transformation. errorGroup is an optional group identifier for the error.

Implementation

@override
Failure<R> flatMap<R>(
  R Function(T value) onSuccess, {
  ExceptionHandler? exceptionHandler,
  String? errorGroup,
}) =>
    Failure(_error);