toFuture<L, R> function

Future<R> toFuture<L, R>(
  1. TaskEither<L, R> taskEither
)

Convert a TaskEither into a Future, that throws an error on Left.

Implementation

Future<R> toFuture<L, R>(TaskEither<L, R> taskEither) =>
    Future.sync(taskEither.call).then(either.fold(
      (_) => Future.error(_ as dynamic),
      identity,
    ));