operator | method

Result<T, E> operator |(
  1. Result<T, E> other
)

Combines two already-evaluated results using the or operator (|).

Shorthand for calling or. Returns this result if it's a success, otherwise returns other. Because Dart evaluates operator operands before calling the operator, use orLazy to defer fallback computation.

Example:

final result = fetchFromCache() | fetchFromNetwork();

Implementation

Result<T, E> operator |(Result<T, E> other) => or(other);