Skip to content

Releases: higorlapa/result

v5.3.0

14 Mar 19:12

Choose a tag to compare

Bug Fixes

  • Error.getOrThrow() now correctly passes <S, E> to SuccessResultNotFoundException, so toString() shows the actual types instead of dynamic.

New Features

  • Result.tryCatch(action, onError) — static factory that wraps a potentially-throwing synchronous computation.
  • getOrElse(orElse) — returns the success value or a fallback computed from the error.
  • onSuccess(action) / onError(action) — side-effect tap methods that execute an action without transforming the result, returning this for chaining.
  • flatMapError(mapper) — symmetric counterpart to flatMap for the error channel.
  • recover(mapper) — alias for flatMapError.
  • swap() — converts Success to Error and vice versa.
  • AsyncResult<S, E> — zero-cost Future<Result<S, E>> wrapper via Dart extension types, with a full mirrored API (mapSuccess, mapError, map, flatMap, flatMapAsync, flatMapError, swap, onSuccess, onError, getOrThrow, getOrElse, tryGetSuccess, tryGetError, when, isSuccess, isError, and tryCatch).
  • AsyncResultOf<S, E> typedef alias for AsyncResult<S, E>.

Full Changelog: v5.2.0...v5.3.0

v5.2.0

29 Apr 14:51

Choose a tag to compare

Full Changelog: v5.1.0...v5.2.0

v5.1.0

17 Jul 22:28

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v5.0.0...v5.1.0

v5.0.0

10 May 19:40

Choose a tag to compare

Full Changelog: v4.0.0...v5.0.0

v4.0.0

21 Dec 18:03

Choose a tag to compare

What's Changed

  • Revert previous releases
  • Change onSuccess and onError to whenSuccess and whenError

Full Changelog: v3.1.0...v4.0.0

v3.1.0

06 Dec 14:12
977f6cb

Choose a tag to compare

What's Changed

Full Changelog: v3.0.0...v3.1.0

v3.0.0

05 Dec 16:08

Choose a tag to compare

What's Changed

  • Add new operators, a Unit type for void return and AsyncResult by @jacobaraujo7 in #5

Full Changelog: v2.0.0...v3.0.0

v2.0.0

03 Dec 10:58

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.4...v2.0.0

Add getSuccess and getError

19 Jul 15:31

Choose a tag to compare

  • Adds getSuccess and getError methods
  • Adds SuccessResult and success const