A typed, curried, ES6+ functions library for pipe style programming.
- You like pipe style programming.
- But Ramda is too cumbersome for you.
- And fp-ts introduce too many FP concepts than you want.
- You just want to use native ES6+ functions with pipe style programming.
Install using Yarn by running yarn add pipeable-es-fns
, or use any package manager you prefer.
And then, leverage pipe style programming with native ES functions:
import {array, object, pipe} from 'pipeable-es-fns'
const _a = pipe(
[1, 2, 3],
array.map((a) => [a, a] as const),
object.fromEntries
)
const _b = pipe({a: 1, b: 2}, object.entries, object.fromEntries)
- Just curried the ES6+ functions and try to keep others untouched.
- Just use the TypeScript official type definitions of ES6+ functions.
- Just delegate the implementation to the native ES6+ functions to avoid runtime.
- Unlike Ramda, the pipe function accepts data as its first argument for better type inference.
- Organize functions into namespace rather than function overloading for better type inference.
- Doesn't support deprecated methods intentionally.
- Encourage to specify the optional arguments explicitly.
- Encourage to use one function in one way only.