initial commit (migrated)
This commit is contained in:
commit
b594facb51
143 changed files with 11057 additions and 0 deletions
11
lib/core/either_extensions.dart
Normal file
11
lib/core/either_extensions.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import 'package:fpdart/fpdart.dart';
|
||||
|
||||
typedef Function1<T, R> = R Function(T t);
|
||||
|
||||
extension EitherFutureX<L, R1> on Future<Either<L, R1>> {
|
||||
Future<Either<L, R2>> chain<R2>(
|
||||
Function1<R1, Future<Either<L, R2>>> f,
|
||||
) async {
|
||||
return (await this).fold(left, f);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue