fromEither<L, R> static method

TaskOption<R> fromEither<L, R>(
  1. Either<L, R> either
)

Build a TaskOption from either that returns None when either is Left, otherwise it returns Some.

Implementation

static TaskOption<R> fromEither<L, R>(Either<L, R> either) =>
    TaskOption(() async => either.match((_) => const Option.none(), some));