Skip to content

Commit

Permalink
Merge pull request #13 from danielsire/master
Browse files Browse the repository at this point in the history
Grammar fixes - 1st try
  • Loading branch information
rafaelfcads committed Jan 8, 2019
2 parents 83acbef + e7ec641 commit 3086ec9
Showing 1 changed file with 38 additions and 39 deletions.
77 changes: 38 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ ResultTools

ResultTools is a standard library for JavaScript functional programming.

The ResultTools library goal is to give developers an auxiliary tool for modeling results of sync and async operations. Voiding the try/catch need, therefor, providing better control of sequences operations, error handling and propagation.
The ResultTools library goal is to provide developers an auxiliary tool for modeling results of sync and async operations. Annuls the try/catch need, therefor, allowing better control of sequence operations, error handling and propagation.

Async operations can be performed by the **`_try`** and **`trySync`** operation to performed sync operations.
The operations results may be, **`Ok(successful Value)`** or **`Error(error Value)`** and can be accessed through the **`get`** or **`orElse`** operations. The operations results offer tests through the **`isOk`** or **`isError`** operations. Based upon the operation results is possible to use fluent features such as **`.chain`**, **`.chainSync`**, **`.serial`**, **`.serialSync`**, **`.map`** and **`.mapSync`** to execute sync and async sequences operations in a controlled way. Operations can also be performed in isolation without the need to perform the try operation.
Async operations can be performed by the **`_try`** and **`trySync`** operation to perform sync operations.
The operation results are, **`Ok(successful Value)`** or **`Error(error Value)`** and can be accessed through the **`get`** or **`orElse`** operations. These results offer tests through the **`isOk`** or **`isError`** operations. Based on the operation results it is possible to use fluent features, such as **`.chain`**, **`.chainSync`**, **`.serial`**, **`.serialSync`**, **`.map`** and **`.mapSync`** to execute sync and async sequence operations in a controlled way.
Also, there is no need to perform the try operation, since it can be used in isolation.

## Installing
## Installation

ResultTools can be installed through [npm][]:

Expand All @@ -24,7 +25,7 @@ ResultTools can be installed through [npm][]:

### Example

- **`_try(fn)`** should be used to execute async operations. The operation results may be, Ok(successful Value) or Error(error Value).
- **`_try(fn)`** should be used to execute async operations. The operation result can be either Ok(successful Value) or Error(error Value).

###### error case:
```js
Expand All @@ -41,15 +42,15 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

const fnPromise = () => Promise.resolve('Voiding the try/catch need');
const fnPromise = () => Promise.resolve('Annuls the try/catch need');

Result._try(fnPromise);

// ==> Result.Ok('Voiding the try/catch need')
// ==> Result.Ok('Annuls the try/catch need')
```


- **`trySync(fn)`** should be used to execute sync operations. The operation results may be, Ok(successful Value) or Error(error Value).
- **`trySync(fn)`** should be used to execute sync operations. The operation result can be either Ok(successful Value) or Error(error Value).

###### error case:
```js
Expand All @@ -66,15 +67,15 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

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

Result.trySync(fnPromise);

// ==> Result.Ok('Voiding the try/catch need')
// ==> Result.Ok('Annuls the try/catch need')
```


- **`chain(fn)`** should be used to execute async operations where this one will be receiving the lasts operations results like arguments to generate a new result.
- **`chain(fn)`** should be used to execute async operations where the arguments are the results from the last operation, generating a new result.


###### error case:
Expand All @@ -98,7 +99,7 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

const fnPromise = () => Promise.resolve('Voiding the');
const fnPromise = () => Promise.resolve('Annuls the');

const fnChain = (arg) => Promise.resolve(`${arg} try/catch need`);

Expand All @@ -107,10 +108,10 @@ ResultTools can be installed through [npm][]:
.chain(fnChain)
.run();

// ==> Result.Ok('Voiding the try/catch need')
// ==> Result.Ok('Annuls the try/catch need')
```

- **`chainSync(fn)`** should be used to execute sync operations where this one will be receiving the lasts operations results like arguments to generate a new result.
- **`chainSync(fn)`** should be used to execute sync operations where the arguments are the results from the last operation, generating a new result.

###### error case:
```js
Expand All @@ -133,7 +134,7 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

const fnPromise = () => Ok('Voiding the');
const fnPromise = () => Ok('Annuls the');

const fnChain = (arg) => Ok(`${arg} try/catch need`);

Expand All @@ -142,10 +143,10 @@ ResultTools can be installed through [npm][]:
.chainSync(fnChain)
.run();

// ==> Result.Ok('Voiding the try/catch need')
// ==> Result.Ok('Annuls the try/catch need')
```

- **`serial(fn, fnArgs)`** should be used to execute async operations where this one could receive arguments to generate a new result.
- **`serial(fn, fnArgs)`** should be used to execute async operations where the arguments could be received, generating a new result.

###### error case:
```js
Expand Down Expand Up @@ -180,7 +181,7 @@ ResultTools can be installed through [npm][]:
// ==> Result.Ok([4, 2])
```

- **`serialSync(fn, fnArgs)`** should be used to execute sync operations where this one could receive arguments to generate a new result.
- **`serialSync(fn, fnArgs)`** should be used to execute sync operations where the arguments could be received, generating a new result.

###### error case:
```js
Expand Down Expand Up @@ -215,7 +216,7 @@ ResultTools can be installed through [npm][]:
// ==> Result.Ok([4, 2])
```

- **`map(fn)`** should be used to execute async transformation operations where this one will be receiving the lasts operations results like arguments to generate a new result.
- **`map(fn)`** should be used to execute async transformation operations where the arguments are the results from the last operation, generating a new result.

###### error case:
```js
Expand All @@ -238,7 +239,7 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

const fnPromise = () => Promise.resolve('Voiding the');
const fnPromise = () => Promise.resolve('Annuls the');

const fnMap = (arg) => Promise.resolve(`${arg} try/catch need`);

Expand All @@ -247,10 +248,10 @@ ResultTools can be installed through [npm][]:
.map(fnMap)
.run();

// ==> Result.Ok('Voiding the try/catch need')
// ==> Result.Ok('Annuls the try/catch need')
```

- **`mapSync(fn)`** should be used to execute sync transformation operations where this one will be receiving the lasts operations results like arguments to generate a new result.
- **`mapSync(fn)`** should be used to execute sync transformation operations where the arguments are the results from the last operation, generating a new result.

###### error case:
```js
Expand All @@ -273,7 +274,7 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

const fnPromise = () => Ok('Voiding the');
const fnPromise = () => Ok('Annuls the');

const fnMap = (arg) => Ok(`${arg} try/catch need`);

Expand All @@ -282,7 +283,7 @@ ResultTools can be installed through [npm][]:
.mapSync(fnMap)
.run();

// ==> Result.Ok('Voiding the try/catch need')
// ==> Result.Ok('Annuls the try/catch need')
```

- **`get`** should be used to access the result value.
Expand All @@ -304,16 +305,16 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

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

Result
.trySync(fnPromise)
.get();

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

- **`orElse(arg)`** should be used to access the successful value or argument value in errors cases.
- **`orElse(arg)`** should be used to access the successful value or argument value in error cases.

###### error case:
```js
Expand All @@ -332,16 +333,16 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

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

Result
.trySync(fnPromise)
.orElse('There is an error');

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

- **`isOk`** should be used to test the result value.
- **`isOk`** should be used to test the result value. Returns **True** if the result value is **Ok**.

###### error case:
```js
Expand All @@ -360,7 +361,7 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

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

Result
.trySync(fnPromise)
Expand All @@ -369,7 +370,7 @@ ResultTools can be installed through [npm][]:
// ==> true
```

- **`isError`** should be used to test the result value.
- **`isError`** should be used to test the result value. Returns **True** if the result value is **Error**.

###### error case:
```js
Expand All @@ -388,7 +389,7 @@ ResultTools can be installed through [npm][]:
```js
const Result = require('result-tool');

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

Result
.trySync(fnPromise)
Expand All @@ -399,7 +400,7 @@ ResultTools can be installed through [npm][]:

## Supported platforms

Result Tools is written for ECMAScript 2015 platforms. If you're running your program in
Result Tools is written for the ECMAScript 2015 platform. If you're running your program in
an older platform, you'll need [es5-shim][] and [es6-shim][].

[es5-shim]: https://github.com/es-shims/es5-shim
Expand All @@ -416,11 +417,9 @@ an older platform, you'll need [es5-shim][] and [es6-shim][].
- [Discussion channel @ Gitter][gitter]
- [Email the organization directly](mailto:resulttoolsfunctionalp@gmail.com)

## Licence
## License

See the `LICENCE` file in this repository for detailed information.
See the `LICENSE` file in this repository for detailed information.

[npm]: https://www.npmjs.com
[gitter]: https://gitter.im/result-tools/discussion


[gitter]: https://gitter.im/result-tools/discussion

0 comments on commit 3086ec9

Please sign in to comment.