Skip to content

Instantly share code, notes, and snippets.

@honzabrecka
Created April 23, 2020 09:51
Show Gist options
  • Save honzabrecka/5b4a00209f1d1de71778559891aaca34 to your computer and use it in GitHub Desktop.
Save honzabrecka/5b4a00209f1d1de71778559891aaca34 to your computer and use it in GitHub Desktop.
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