Function: pipe()
Returns the result of piping value
through the given functions.
Example
import { map, pipe, reduce, toArray } from 'lfi'
console.log(
pipe(
[`sloth`, `lazy`, `sleep`],
map(word => word.toUpperCase()),
reduce(toArray()),
// Also works with non-`lfi` functions!
array => array.sort(),
),
)
//=> [ 'SLOTH', 'LAZY', 'SLEEP' ]
Since
v0.0.1
Call Signature
pipe<
Value
>(value
):Value
Type Parameters
• Value
Parameters
value
Value
Returns
Value
Defined in
Call Signature
pipe<
A
,B
>(value
,fn
):B
Type Parameters
• A
• B
Parameters
value
A
fn
(a
) => B
Returns
B
Defined in
Call Signature
pipe<
A
,B
,C
>(value
,fn1
,fn2
):C
Type Parameters
• A
• B
• C
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
Returns
C
Defined in
Call Signature
pipe<
A
,B
,C
,D
>(value
,fn1
,fn2
,fn3
):D
Type Parameters
• A
• B
• C
• D
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
Returns
D
Defined in
Call Signature
pipe<
A
,B
,C
,D
,E
>(value
,fn1
,fn2
,fn3
,fn4
):E
Type Parameters
• A
• B
• C
• D
• E
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
Returns
E
Defined in
Call Signature
pipe<
A
,B
,C
,D
,E
,F
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
):F
Type Parameters
• A
• B
• C
• D
• E
• F
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
fn5
(e
) => F
Returns
F
Defined in
Call Signature
pipe<
A
,B
,C
,D
,E
,F
,G
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
):G
Type Parameters
• A
• B
• C
• D
• E
• F
• G