Pipe and Compose for TypeScript
pipe
, pipeline
, and compose
functions with TypeScript definitions
What's the point?
This package not only provides simple pipe
, pipeline
, and compose
implementation, it also provides many TypeScript overloads for each function. [See index.d.ts]
Usage
APIs
pipe
Signature: pipe (value, ...functions) → result
const y =
is equivalent to
const x1 = const x2 = const x3 = const y =
or
const y =
pipeline
Signature: pipeline (...functions) → function
const fn =
is equivalent to
const fn =
compose
Signature: compose (...functions) → function
const fn =
is equivalent to
const fn =
composeRight
It is just an alias of pipeline
Example
// pipeconst y0 = // pipelineconst g1 = const y1 = // composeconst g2 = const y2 =