onSuccess method

Result<T> onSuccess(
  1. void action(
    1. T value
    )
)

Run a side-effect on success, then return this unchanged.

Implementation

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