Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nesterow authored Dec 1, 2024
1 parent 9051b35 commit dd65f5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ Simplified result/error handling for JavaScript.
Grip always returns a consistent call result ready to be handled.
It makes the control flow similar to that of Golang, but doesn't force you to make additional null checks or create transitional variables to hold error results.

> Grip doesn't force you to write code in a specific style or avoid using throw. It is just a helper that unwraps try-catch.
Instead of returning a nullish error, Grip always returns a consistent status object:

Instead of returning a nullish error, Grip always returns a consistent status interface:

```javascript
const [value, status] = grip(callable) // or {value, status}
Expand Down Expand Up @@ -117,7 +119,7 @@ const [result1, status1] = grip(() => {

## Handle generators

Generators can be handled using the `Iter()` method:
Generators can be handled using the `iter()` method:

```javascript
const res = grip(async function* () {
Expand Down

0 comments on commit dd65f5d

Please sign in to comment.