Skip to content

Releases: respawn-app/ApiResult

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