onSuccess method

Result<T, E> onSuccess(
  1. void action(
    1. T
    )
)

Executes the given function with the success value if this is a success

Implementation

Result<T, E> onSuccess(void Function(T) action) {
  if (this case Success(value: final value)) {
    action(value);
  }
  return this;
}