Skip to content

Commit

Permalink
update docs / readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek-12 committed Jul 5, 2024
1 parent 6df567a commit 51df491
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ error handling **on steroids**.

## Features

* ApiResult is **lightweight**. The library tries to inline operators and reduce allocations where possible.
* ApiResult is **lightweight**. The library creates no objects, makes no allocations or virtual function resolutions.
Most of the code is inlined.
* ApiResult offers 90+ operators covering most of possible use cases to turn your
code from imperative and procedural to declarative and functional, which is more readable and extensible.
* ApiResult defines a contract that you can use in your code. No one will be able to obtain the result of a computation
without being forced to handle errors at compilation time.
* The library has 129 tests for 92% operator coverage.

## Preview

Expand Down
7 changes: 3 additions & 4 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,12 @@ interface Repository {
}
val subscriptions: ApiResult<List<Subscription>> = ApiResult {
val verificationResult = repo.verifyDevice()
// bang (!) operator throws Errors, equivalent to binding
// if bang does not throw, the device is verified
!verificationResult
val verificationResult = !repo.verifyDevice()
val user: User = !userRepository.getUser() // if bang does not throw, user is logged in
// if bang does not throw, user is logged in
val user: User = !userRepository.getUser()
!repo.getSubscriptions(user)
}
Expand Down

0 comments on commit 51df491

Please sign in to comment.