word choice

This commit is contained in:
yazeedb
2018-04-18 20:47:57 -04:00
parent eea09ac106
commit 35c0412b40

View File

@ -1,7 +1,7 @@
### when
Tests a value, `x`, against a predicate function. If `true`, return `fn(x)`. Else, return `x`.
`when(pred, whenTrue)` returns another function expecting `x` for better composability.
`when(pred, whenTrue)` returns a function expecting `x` for better composability.
```js
const when = (pred, whenTrue) => (x) => pred(x) ? whenTrue(x) : x;