FutureEitherX<L, R> extension

Future Either Extension

on

Properties

isEitherLeft Future<bool>
Represents the left side of Either class which by convention is a "Failure".
no setter
isEitherRight Future<bool>
Represents the right side of Either class which by convention is a "Success"
no setter

Methods

castEither<F, S>() Future<Either<F, S>>
Future Cast to new Left & Right type
either({required EitherCallback<L> onLeft, required EitherCallback<R> onRight}) Future<void>
Future Either type result on Callback
mapEither({required MapCallback<L> onLeft, required MapCallback<R> onRight}) Future<Either<L, R>>
Return the Future Either result in one of these functions.
mapEitherAsync({required AsyncMapCallback<L> onLeft, required AsyncMapCallback<R> onRight}) Future<Either<L, R>>
Return the async Future Either result in one of these async functions.
maybeWhenEither<T>({WhenCallback<T, L>? onLeft, WhenCallback<T, R>? onRight, required MaybeCallback<T> orElse}) Future<T>
The maybeWhenEither method is equivalent to whenEither, but doesn't require all callbacks to be specified. On the other hand, it adds an extra orElse required parameter, for fallback behavior.
maybeWhenEitherAsync<T>({AsyncWhenCallback<T, L>? onLeft, AsyncWhenCallback<T, R>? onRight, required AsyncMaybeCallback<T> orElse}) Future<T>
The maybeWhenEitherAsync method is equivalent to whenEitherAsync, but doesn't require all callbacks to be specified. On the other hand, it adds an extra orElse required parameter, for fallback behavior.
swapEither() Future<Either<R, L>>
Future Swap Left and Right
whenEither<T>({required WhenCallback<T, L> onLeft, required WhenCallback<T, R> onRight}) Future<T>
Return the Future result in one of these functions.
whenEitherAsync<T>({required AsyncWhenCallback<T, L> onLeft, required AsyncWhenCallback<T, R> onRight}) Future<T>
Return the async Future result in one of these async functions.