whenAsync<R> abstract method

Future<R> whenAsync<R>({
  1. required Future<R> ok(
    1. T
    ),
  2. required Future<R> err(
    1. E
    ),
})

Asynchronously invokes either ok or err depending on the result.

Identical to match except that the arguments are named.

Implementation

Future<R> whenAsync<R>({
  required Future<R> Function(T) ok,
  required Future<R> Function(E) err,
});