ortense
7/27/2017 - 5:58 PM

simple and small pipe function

simple and small pipe function

const pipe = (...fns) => arg => 
  fns.reduce((acc, fn) => fn(acc), arg)

/*
const a = x => `a(${x})`
const b = x => `b(${x})`
const c = x => `c(${x})`

const piped = compose(a, b, c) 

piped('x') // c(b(a(x)))
*/