From 02d96c0d70c041fc4ce1f8903b827064a71e65d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petrus=20Nguy=E1=BB=85n=20Th=C3=A1i=20H=E1=BB=8Dc?= Date: Tue, 23 Aug 2022 23:34:04 +0700 Subject: [PATCH] docs --- README.md | 95 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 85a126a..7e86965 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,9 @@ dependencies: ## Documentation & example - - Documentation: https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/dart_either-library.html - - Example: https://github.com/hoc081098/dart_either/tree/master/example/lib + - **Documentation**: https://pub.dev/documentation/dart_either/latest/dart_either/dart_either-library.html + - **Example**: https://github.com/hoc081098/dart_either/tree/master/example/lib + - **Flutter Example**: https://github.com/hoc081098/node-auth-flutter-BLoC-pattern-RxDart ## Either monad @@ -137,18 +138,18 @@ final nullableValue = right.orNull(); // 10 -## Use - [Documentation](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/dart_either-library.html) +## Use - [Documentation](https://pub.dev/documentation/dart_either/latest/dart_either/dart_either-library.html) ### 1. Creation #### 1.1. Factory constructors -- [Either.left](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/Either.left.html) -- [Either.right](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/Either.right.html) -- [Either.binding](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/Either.binding.html) -- [Either.catchError](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/Either.catchError.html) -- [Left](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Left/Left.html) -- [Right](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Right-class.html) +- [Either.left](https://pub.dev/documentation/dart_either/latest/dart_either/Either/Either.left.html) +- [Either.right](https://pub.dev/documentation/dart_either/latest/dart_either/Either/Either.right.html) +- [Either.binding](https://pub.dev/documentation/dart_either/latest/dart_either/Either/Either.binding.html) +- [Either.catchError](https://pub.dev/documentation/dart_either/latest/dart_either/Either/Either.catchError.html) +- [Left](https://pub.dev/documentation/dart_either/latest/dart_either/Left/Left.html) +- [Right](https://pub.dev/documentation/dart_either/latest/dart_either/Right-class.html) ```dart // Left('Left value') @@ -173,14 +174,14 @@ Either.catchError( #### 1.2. Static methods -- [Either.catchFutureError](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/catchFutureError.html) -- [Either.catchStreamError](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/catchStreamError.html) -- [Either.fromNullable](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/fromNullable.html) -- [Either.futureBinding](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/futureBinding.html) -- [Either.parSequenceN](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/parSequenceN.html) -- [Either.parTraverseN](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/parTraverseN.html) -- [Either.sequence](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/sequence.html) -- [Either.traverse](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/traverse.html) +- [Either.catchFutureError](https://pub.dev/documentation/dart_either/latest/dart_either/Either/catchFutureError.html) +- [Either.catchStreamError](https://pub.dev/documentation/dart_either/latest/dart_either/Either/catchStreamError.html) +- [Either.fromNullable](https://pub.dev/documentation/dart_either/latest/dart_either/Either/fromNullable.html) +- [Either.futureBinding](https://pub.dev/documentation/dart_either/latest/dart_either/Either/futureBinding.html) +- [Either.parSequenceN](https://pub.dev/documentation/dart_either/latest/dart_either/Either/parSequenceN.html) +- [Either.parTraverseN](https://pub.dev/documentation/dart_either/latest/dart_either/Either/parTraverseN.html) +- [Either.sequence](https://pub.dev/documentation/dart_either/latest/dart_either/Either/sequence.html) +- [Either.traverse](https://pub.dev/documentation/dart_either/latest/dart_either/Either/traverse.html) ```dart import 'package:http/http.dart' as http; @@ -270,10 +271,10 @@ Either> urisEither = Either.traverse( ``` #### 1.3. Extension methods -- [Stream.toEitherStream](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/ToEitherStreamExtension/toEitherStream.html) -- [Future.toEitherFuture](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/ToEitherFutureExtension/toEitherFuture.html) -- [T.left](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/ToEitherObjectExtension/left.html) -- [T.right](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/ToEitherObjectExtension/right.html) +- [Stream.toEitherStream](https://pub.dev/documentation/dart_either/latest/dart_either/ToEitherStreamExtension/toEitherStream.html) +- [Future.toEitherFuture](https://pub.dev/documentation/dart_either/latest/dart_either/ToEitherFutureExtension/toEitherFuture.html) +- [T.left](https://pub.dev/documentation/dart_either/latest/dart_either/ToEitherObjectExtension/left.html) +- [T.right](https://pub.dev/documentation/dart_either/latest/dart_either/ToEitherObjectExtension/right.html) ```dart /// Stream.toEitherStream @@ -301,35 +302,35 @@ Either right = 2.right(); ### 2. Operations -- [isLeft](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/isLeft.html) -- [isRight](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/isRight.html) -- [fold](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/fold.html) -- [foldLeft](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/foldLeft.html) -- [swap](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/swap.html) -- [tapLeft](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/tapLeft.html) -- [tap](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/tap.html) -- [map](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/map.html) -- [mapLeft](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/mapLeft.html) -- [flatMap](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/flatMap.html) -- [bimap](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/bimap.html) -- [exists](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/exists.html) -- [all](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/all.html) -- [getOrElse](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/getOrElse.html) -- [orNull](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/orNull.html) -- [getOrHandle](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/getOrHandle.html) -- [findOrNull](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/findOrNull.html) -- [when](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/when.html) -- [handleErrorWith](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/handleErrorWith.html) -- [handleError](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/handleError.html) -- [redeem](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/redeem.html) -- [redeemWith](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/Either/redeemWith.html) -- [toFuture](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/AsFutureEitherExtension/toFuture.html) -- [getOrThrow](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/GetOrThrowEitherExtension/getOrThrow.html) +- [isLeft](https://pub.dev/documentation/dart_either/latest/dart_either/Either/isLeft.html) +- [isRight](https://pub.dev/documentation/dart_either/latest/dart_either/Either/isRight.html) +- [fold](https://pub.dev/documentation/dart_either/latest/dart_either/Either/fold.html) +- [foldLeft](https://pub.dev/documentation/dart_either/latest/dart_either/Either/foldLeft.html) +- [swap](https://pub.dev/documentation/dart_either/latest/dart_either/Either/swap.html) +- [tapLeft](https://pub.dev/documentation/dart_either/latest/dart_either/Either/tapLeft.html) +- [tap](https://pub.dev/documentation/dart_either/latest/dart_either/Either/tap.html) +- [map](https://pub.dev/documentation/dart_either/latest/dart_either/Either/map.html) +- [mapLeft](https://pub.dev/documentation/dart_either/latest/dart_either/Either/mapLeft.html) +- [flatMap](https://pub.dev/documentation/dart_either/latest/dart_either/Either/flatMap.html) +- [bimap](https://pub.dev/documentation/dart_either/latest/dart_either/Either/bimap.html) +- [exists](https://pub.dev/documentation/dart_either/latest/dart_either/Either/exists.html) +- [all](https://pub.dev/documentation/dart_either/latest/dart_either/Either/all.html) +- [getOrElse](https://pub.dev/documentation/dart_either/latest/dart_either/Either/getOrElse.html) +- [orNull](https://pub.dev/documentation/dart_either/latest/dart_either/Either/orNull.html) +- [getOrHandle](https://pub.dev/documentation/dart_either/latest/dart_either/Either/getOrHandle.html) +- [findOrNull](https://pub.dev/documentation/dart_either/latest/dart_either/Either/findOrNull.html) +- [when](https://pub.dev/documentation/dart_either/latest/dart_either/Either/when.html) +- [handleErrorWith](https://pub.dev/documentation/dart_either/latest/dart_either/Either/handleErrorWith.html) +- [handleError](https://pub.dev/documentation/dart_either/latest/dart_either/Either/handleError.html) +- [redeem](https://pub.dev/documentation/dart_either/latest/dart_either/Either/redeem.html) +- [redeemWith](https://pub.dev/documentation/dart_either/latest/dart_either/Either/redeemWith.html) +- [toFuture](https://pub.dev/documentation/dart_either/latest/dart_either/AsFutureEitherExtension/toFuture.html) +- [getOrThrow](https://pub.dev/documentation/dart_either/latest/dart_either/GetOrThrowEitherExtension/getOrThrow.html) ### 3. Extensions on `Future>`. -- [thenFlatMapEither](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/AsyncFlatMapFutureExtension/thenFlatMapEither.html) -- [thenMapEither](https://pub.dev/documentation/dart_either/1.0.0-beta06/dart_either/AsyncMapFutureExtension/thenMapEither.html) +- [thenFlatMapEither](https://pub.dev/documentation/dart_either/latest/dart_either/AsyncFlatMapFutureExtension/thenFlatMapEither.html) +- [thenMapEither](https://pub.dev/documentation/dart_either/latest/dart_either/AsyncMapFutureExtension/thenMapEither.html) ```dart Future> httpGetAsEither(String uriString) {