Skip to content

Commit

Permalink
write README
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfcads committed Jan 1, 2019
1 parent 88c9a04 commit fca33f5
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,33 @@ ResultTools can be installed through [npm][]:
// ==> Result.Ok('Voiding the try/catch need')
```

- **`.get`**
- **`.get`** should be used to access the result value.

###### error case:
```js
const Result = require('result-tool');

const fnPromise = () => Error(-1);

Result
.trySync(fnPromise)
.get();

// ==> -1
```

###### successful case:
```js
const Result = require('result-tool');

const fnPromise = () => Ok('Voiding the try/catch need');

Result
.trySync(fnPromise)
.get();

// ==> 'Voiding the try/catch need'
```

- **`.orElse`**

Expand Down

0 comments on commit fca33f5

Please sign in to comment.