andThen<U> method

Result<U, E> andThen<U>(
  1. Result<U, E> op(
    1. T value
    )
)

Calls op if the result is Ok, otherwise returns the Err value of this.

This function can be used for control flow based on Result values.

Implementation

Result<U, E> andThen<U>(Result<U, E> Function(T value) op) =>
    isOk ? op(_okValue) : Err(_errValue);