Skip to content

Releases: Flutterando/result_dart

v2.0.0

11 Dec 20:44
8e0aa2a
Compare
Choose a tag to compare
  • This version aims to reduce the Result boilerplate by making the Failure type Exception by default. This will free the Result from having to type Failure, making the declaration smaller.

If there is a need to type Failure, use ResultDart.

Added

  • Introduced typedef for Result<S> and AsyncResult<S> to simplify usage:
    • Result<S> is a simplified alias for ResultDart<S, Exception>.
    • AsyncResult<S> is a simplified alias for AsyncResultDart<S, Exception>.

Changed

  • Replaced Result class with ResultDart as the base class for all results.
    • Default failure type for ResultDart is now Exception.
    • This change reduces boilerplate and improves usability by eliminating the need to specify the failure type explicitly in most cases.

Removed

  • Remove factories Result.success and Result.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, use ResultDart<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

11 Dec 20:33
651113e
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.5...1.1.1

v1.0.5

26 Jan 23:21
Compare
Choose a tag to compare

feat: Added FutureOr in AsyncResult.MapError

v1.0.4

26 Jan 04:38
Compare
Choose a tag to compare

feat: Added FutureOr in AsyncResult.Map

v1.0.3

22 Dec 22:01
Compare
Choose a tag to compare

fix: AsyncResult recover

v1.0.2

18 Dec 19:50
Compare
Choose a tag to compare

fix: separed functions.dart import

v1.0.1

17 Dec 15:12
Compare
Choose a tag to compare
  • fix: recover operator return a Result instead a Result.

v1.0.0

16 Dec 18:59
Compare
Choose a tag to compare
  • Initial version