Skip to content

Releases: respawn-app/ApiResult

2.0.0

08 Aug 12:37
9d7ff03
Compare
Choose a tag to compare

❔ Other

  • Bump kotlin to 2.0.10

2.0.0-beta02

26 Jul 09:46
d9d87d6
Compare
Choose a tag to compare

Maintenance update

  • bump gradle
  • migrate to new sonatype publishing workflow
  • Update minor dependencies

2.0.0-beta01

05 Jul 16:51
fbd8223
Compare
Choose a tag to compare
  • Fixed ClassCastExceptions on some operators
  • Updated dependencies
  • Added 129 tests for base result operators to prevent future issues

2.0.0-alpha01

18 Jun 17:01
28f3595
Compare
Choose a tag to compare

🚀 New Features

Breaking change: Refactor ApiResult to be an inline class. ApiResult can no longer be used in switch statements. Use the fold function instead.

1.1.0

30 May 12:27
ae89f0d
Compare
Choose a tag to compare
  • Update to kotlin 2.0
  • Update coroutines to 1.9.0
  • Enable wasm-wasi target
  • Breaking change: Make ApiResult.Loading no longer a companion object of ApiResult as it wasn't resolved correctly in when() branches

1.0.4

15 Apr 18:39
208dc65
Compare
Choose a tag to compare
  • Added Wasm target
  • New extensions: requireIs, Flow.orThrow, Flow.orNull, accumulate, mapResulting and others

Full Changelog: 1.0.3...1.0.4

1.0.3

25 Dec 11:25
ad8b174
Compare
Choose a tag to compare
  • recoverIf has been renamed to tryRecoverIf, and recoverIf now is a function that should return an ApiResult. This is done to prevent declaration clashes since kotlin doesn't yet know how to resolve overloads.
  • Kotlin 1.9.22
  • NotFinishedException now extends IllegalStateException instead of IllegalArgumentException
  • Fixed ApiResult builder function returning Loading. Previous behavior was to return Success, this reverts back to that
  • New operators - recoverIf, apply. Apply is the same as map but takes this as a parameter

1.0.2: Dependency updates, some new operators

11 Dec 15:19
2b37dfd
Compare
Choose a tag to compare
  • Loading is now a companion object and an instance of ApiResult at the same time, so you can use all the rest of the operators on the static companion object instance
  • ApiResult.flow with non-api-result return type has been renamed to ApiResult.tryFlow because of the conflicts between the names of two functions. Unfortunately it seems impossible to resolve the overload dynamically
  • Same as above, but for recover.

1.0.1

29 Aug 17:06
1.0.1
4b1cc50
Compare
Choose a tag to compare
  • Added ApiResult.unit() map function
  • Added mapError/recover overloads for typed/not typed versions
  • Added a sample app
  • Updated Readme with sleek badges
  • Fixed Javadocs website

Full Changelog: 1.0.0...1.0.1

1.0.0 - initial release as a separate library

26 Aug 18:21
7fe114c
Compare
Choose a tag to compare

ApiResult is now separate from KMMUtils!

A few updates were made along the way.

  • Changed package from pro.respawn.kmmutils.apiresult to just pro.respawn.apiresult. A simple Replace action in the IDE should be enough to fix this
  • message, cause and stacktrace are now extensions on Error, so you'll have to add a few imports
  • removed deprecated mapWrapping, recoverWrapping
  • new operators: destructuring operator val (success, error) = ApiResult() and bang (!) equivalent to orThrow()
  • errorIfNot has been renamed to errorUnless for parity with stdlib. Auto replace deprecated functions with an IDE action.
  • new expanded documentation
  • New functions:
    • flatMap
    • require() (without args)
    • mapEither
    • mapOrDefault
    • errorOnLoading
  • New collection functions:
    • filter
    • errorOnEmpty
    • onEmpty / ifEmpty
    • merge
    • values
    • firstSuccess