getOrElse method

Task<R> getOrElse(
  1. R orElse(
    1. L l
    )
)

Convert this TaskEither to a Task.

The task returns a Right when TaskEither returns Right. Otherwise map the type L of TaskEither to type R by calling orElse.

Implementation

Task<R> getOrElse(R Function(L l) orElse) =>
    Task(() async => (await run()).match(orElse, identity));