Skip to main content

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' ]
Playground

Since

v0.0.1

Call Signature

pipe<Value>(value): Value

Type Parameters

Value

Parameters

value

Value

Returns

Value

Defined in

core.d.ts:84

Call Signature

pipe<A, B>(value, fn): B

Type Parameters

A

B

Parameters

value

A

fn

(a) => B

Returns

B

Defined in

core.d.ts:85

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

core.d.ts:86

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

core.d.ts:87

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

core.d.ts:93

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

core.d.ts:100

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

Parameters

value

A

fn1

(a) => B

fn2

(b) => C

fn3

(c) => D

fn4

(d) => E

fn5

(e) => F

fn6

(f) => G

Returns

G

Defined in

core.d.ts:108

Call Signature

pipe<A, B, C, D, E, F, G, H>(value, fn1, fn2, fn3, fn4, fn5, fn6, fn7): H

Type Parameters

A

B

C

D

E

F

G

H

Parameters

value

A

fn1

(a) => B

fn2

(b) => C

fn3

(c) => D

fn4

(d) => E

fn5

(e) => F

fn6

(f) => G

fn7

(g) => H

Returns

H

Defined in

core.d.ts:117

Call Signature

pipe<A, B, C, D, E, F, G, H, I>(value, fn1, fn2, fn3, fn4, fn5, fn6, fn7, fn8): I

Type Parameters

A

B

C

D

E

F

G

H

I

Parameters

value

A

fn1

(a) => B

fn2

(b) => C

fn3

(c) => D

fn4

(d) => E

fn5

(e) => F

fn6

(f) => G

fn7

(g) => H

fn8

(h) => I

Returns

I

Defined in

core.d.ts:127

Call Signature

pipe<A, B, C, D, E, F, G, H, I, J>(value, fn1, fn2, fn3, fn4, fn5, fn6, fn7, fn8, fn9): J

Type Parameters

A

B

C

D

E

F

G

H

I

J

Parameters

value

A

fn1

(a) => B

fn2

(b) => C

fn3

(c) => D

fn4

(d) => E

fn5

(e) => F

fn6

(f) => G

fn7

(g) => H

fn8

(h) => I

fn9

(i) => J

Returns

J

Defined in

core.d.ts:138