remove deprecated methods from Future[Either]
Either
is now sealed - this gives you support pattern matching.
You now have an alternative for the fold and either
before:
final either = ...;
final result = either.fold(
(left) => do something with left
(right) => do something with right
);
after:
final either = ...;
switch (either) {
case Left(value: final left):
do something with left
case Right(value: final right):
do something with right
}
Thanks to @dballance for creating the issue
Also, you can still use:
either.isLeft
- check either is left
either.isRight
- check either is right
Provide more async flexible type support for FutureEither's fold operation.
Thanks to @lukasbalaz for creating the issue
add:
- tryExcept -
A simple but powerful constructor for exception handling. Just specify the type of error you expect from the function and you will get
Either<ExpectedError, RightType>
Either now overrides equality and hash.
Thanks to @memishood for creating the issue
Updated to support FutureOr<T>
instead of Future<T>
:
- Either:
- thenAsync
- thenLeftAsync
- mapAsync
- mapLeftAsync
- Future[Either]:
- thenRight
- thenLeft
Updated to support FutureOr<T>
instead of T
:
- Future[Either]:
- mapRight
- mapLeft
Mark deprecated (not delete):
- Future[Either].thenRightSync
- Future[Either].thenLeftSync
- Future[Either].mapRightAsync
- Future[Either].mapLeftAsync
The following methods were not needed after FutureOr
support, so they are marked Deprecated.
Update:
- Readme
(just this)
Added:
- thenLeft
- thenLeftAsync
- similiar methods for
FutureEither<L, R>
extension
Fixed:
- remove the lint warning from Either.tryCatch
Added:
- mapLeftAsync
FutureEither<L, R>
extension
Fixed:
- change the naming of the async methods of
Either
class
Changes Either
:
- asyncThen -> thenAsync
- asyncMap -> mapAsync
Added:
- mapLeft
Fixed:
- documentation
Added:
- null-safety
- swap method
- const constructor for Left and Right
Changed:
- rename unite to fold
Added:
- asyncMap
- asyncThen
Fixed:
- Not convenient use with autocomplete
Added:
- Unit test
- Lazy condition
- Flutter example
Added:
- Unit test
- creators by:
- condition
- exception
Fixed:
- pubspec
- Readme
Added:
- Base implementation
- Unit test
- Example with flutter