mobily / ts-belt

🔧 Fast, modern, and practical utility library for FP in TypeScript.
https://mobily.github.io/ts-belt
MIT License
1.1k stars 30 forks source link

[Feature Request] `createPipe` Creates a data-last pipe function. #39

Closed nghiepdev closed 2 years ago

nghiepdev commented 2 years ago

Creates a data-last pipe function. First function must be always annotated. Other functions are automatically inferred.

R.createPipe(op1, op2, op3)(data)

createPipe(
  (x: number) => x * 2,
  (x) => x * 3
)(1) // => 6
mobily commented 2 years ago

@nghiepit createPipe is named flow in ts-belt and it's here → https://mobily.github.io/ts-belt/api/pipe-flow#flow :)