Created
April 23, 2020 09:51
-
-
Save honzabrecka/5b4a00209f1d1de71778559891aaca34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const when = (pred, f) => (data) => pred(data) ? f(data) : data | |
// example | |
pipe( | |
when(isOdd, increment), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment