Pipe β
Last updated
Was this helpful?
Last updated
Was this helpful?
Pipe is a common function composed of function arguments that returns their value to the next function until returning a final value in the opposite order of compose.
yarn add @common-utilities/pipe -D
const add1 = (val) => val + 1
const subtract2 = (val) => val - 2
const multiplyBy3 = (val) => val * 3
const result = pipe(add1, subtract2, multiplyBy3)
result(3) // 8 (3 * 3 - 2 + 1)
No cruft. No bloat. No dependencies.
Simple, typed, functional, documented, and tested javascript utility functions.
View other common utilities on Github.