Releases: respawn-app/ApiResult
Releases · respawn-app/ApiResult
2.0.0
2.0.0-beta02
Maintenance update
- bump gradle
- migrate to new sonatype publishing workflow
- Update minor dependencies
2.0.0-beta01
- Fixed ClassCastExceptions on some operators
- Updated dependencies
- Added 129 tests for base result operators to prevent future issues
2.0.0-alpha01
🚀 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
- 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
- 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
recoverIf
has been renamed totryRecoverIf
, andrecoverIf
now is a function that should return anApiResult
. 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 ofIllegalArgumentException
- Fixed
ApiResult
builder function returningLoading
. Previous behavior was to returnSuccess
, this reverts back to that - New operators -
recoverIf
,apply
. Apply is the same asmap
but takesthis
as a parameter
1.0.2: Dependency updates, some new operators
- 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 toApiResult.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
- 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
ApiResult is now separate from KMMUtils!
A few updates were made along the way.
- Changed package from
pro.respawn.kmmutils.apiresult
to justpro.respawn.apiresult
. A simple Replace action in the IDE should be enough to fix this message
,cause
andstacktrace
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 toorThrow()
errorIfNot
has been renamed toerrorUnless
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