Pipe ⛓

@common-utilities/pipe 🧰

Typed with TypeScript npm version

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.

Install

yarn add @common-utilities/pipe -D

Usage

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)

Common Utilities 🧰

No cruft. No bloat. No dependencies.

Simple, typed, functional, documented, and tested javascript utility functions.

View other common utilities on Github.

Last updated

Was this helpful?