whenEitherAsync<T> method
Future<T>
whenEitherAsync<T>({
- required AsyncWhenCallback<
T, L> onLeft, - required AsyncWhenCallback<
T, R> onRight,
Return the async Future result in one of these async functions.
if the result is an Left, it will be returned in onLeft
,
if it is a Right it will be returned in onRight
.
Implementation
Future<T> whenEitherAsync<T>({
required AsyncWhenCallback<T, L> onLeft,
required AsyncWhenCallback<T, R> onRight,
}) async =>
(await this).whenAsync(
onLeft: onLeft,
onRight: onRight,
);