Skip to content

Commit

Permalink
chore: improve docs
Browse files Browse the repository at this point in the history
Fixes: #17
  • Loading branch information
koraa committed Jul 12, 2019
1 parent 7eb22ea commit 7450e89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ of traits at once.
```js
const {plus, and, not, is, xor, map, list} = require('ferrum');

list(map([1,2,3], plus(2))); // => [2,3,4]
list(map([1,2,3], plus(2))); // => [3,4,5]
and(True, False); // => False
not(1); // => False
is(2, 2); // => True
Expand Down
10 changes: 8 additions & 2 deletions src/functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,19 @@ const pipe = (val, ...fns) => fns.reduce((v, fn) => fn(v), val);
/**
* Function composition.
*
* This essentially behaves like `pipe()` without taking the initial argument:#
* executed left-to-rigt/top-to-bottom.
*
* ```
* const {compose} = require('ferrum');
*
* const fn = compose(
* (x) => x+2,
* (x) => x*3
* (x) => x*3,
* (x) => `My Number ${x}`
* );
*
* console.log(fn(4)); // => 18
* console.log(fn(4)); // => "My Number 18"
* ```
*
* @param {Function} fns Multiple functions
Expand Down

0 comments on commit 7450e89

Please sign in to comment.