Releases: Flutterando/result_dart
Releases · Flutterando/result_dart
v2.0.0
- This version aims to reduce the
Result
boilerplate by making theFailure
type Exception by default. This will free the Result from having to typeFailure
, making the declaration smaller.
If there is a need to type Failure
, use ResultDart
.
Added
- Introduced
typedef
forResult<S>
andAsyncResult<S>
to simplify usage:Result<S>
is a simplified alias forResultDart<S, Exception>
.AsyncResult<S>
is a simplified alias forAsyncResultDart<S, Exception>
.
Changed
- Replaced
Result
class withResultDart
as the base class for all results.- Default failure type for
ResultDart
is nowException
. - This change reduces boilerplate and improves usability by eliminating the need to specify the failure type explicitly in most cases.
- Default failure type for
Removed
- Remove factories
Result.success
andResult.failure
.
Migration Guide
- In version >=2.0.0, the Failure typing is by default an
Exception
, but if there is a need to type it, useResultDart<Success, Failure>
.
only Success
type:
// Old
Result<int, Exception> myResult = Success(42);
// NEW
Result<int> myResult = Success(42);
with Success
and Failure
types:
// Old
Result<int, String> myResult = Success(42);
// NEW
ResultDart<int, String> myResult = Success(42);
v1.1.1
What's Changed
- Feature/const constructors by @eKaramihov in #4
- fix: remove unused generic param in onSuccess and onFailure by @davidmigloz in #5
- Update README.md discord link by @thKali in #14
- Update .gitignore to include .vscode directory by @EchoEllet in #9
- Delete .vscode/settings.json by @EchoEllet in #10
New Contributors
- @eKaramihov made their first contribution in #4
- @davidmigloz made their first contribution in #5
- @thKali made their first contribution in #14
- @EchoEllet made their first contribution in #9
Full Changelog: v1.0.5...1.1.1
v1.0.5
feat: Added FutureOr in AsyncResult.MapError
v1.0.4
feat: Added FutureOr in AsyncResult.Map
v1.0.3
fix: AsyncResult recover
v1.0.2
fix: separed functions.dart import
v1.0.1
- fix: recover operator return a
Result
instead aResult
.
v1.0.0
- Initial version