dartz icon indicating copy to clipboard operation
dartz copied to clipboard

Add catchAsync for Eithers

Open otto-dev opened this issue 3 years ago • 0 comments

Closes #105. Allows to use catchAsync in place of catching for asynchronous contexts.

Example usage:

  Future<Either<dynamic, FooBar>> doAsyncThings() {
    return catchAsync(() async {
      final foo = await asyncAction();
      final bar = await asyncAction();
      return foo + bar;
    });
  }

Went for catchAsync instead of catchingAsync.

otto-dev avatar Apr 15 '22 22:04 otto-dev