catchAsync<A> function

Future<Either<dynamic, A>> catchAsync<A>(
  1. Function0<FutureOr<A>> f
)

Implementation

Future<Either<dynamic, A>> catchAsync<A>(final Function0<FutureOr<A>> f) async {
  try {
    return right(await f());
  } catch (e) {
    return left(e);
  }
}