foldAsync<B> method

Future<B> foldAsync<B>(
  1. FutureOr<B> ifLeft(
    1. L left
    ),
  2. FutureOr<B> ifRight(
    1. R right
    )
)

Asynchronously applies one of two functions depending on the side present.

Implementation

Future<B> foldAsync<B>(
  FutureOr<B> Function(L left) ifLeft,
  FutureOr<B> Function(R right) ifRight,
) async {
  return fold(ifLeft, ifRight);
}