Skip to content

flow

flow<A, B>(ab): (…a) => B

Defined in: Composition/flow.ts:40

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

(…a) => B

(…a): B

A

B

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C>(ab, bc): (…a) => C

Defined in: Composition/flow.ts:43

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

(…a) => B

(b) => C

(…a): C

A

C

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D>(ab, bc, cd): (…a) => D

Defined in: Composition/flow.ts:47

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

(…a) => B

(b) => C

(c) => D

(…a): D

A

D

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D, E>(ab, bc, cd, de): (…a) => E

Defined in: Composition/flow.ts:52

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

E

(…a) => B

(b) => C

(c) => D

(d) => E

(…a): E

A

E

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D, E, F>(ab, bc, cd, de, ef): (…a) => F

Defined in: Composition/flow.ts:58

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

E

F

(…a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(…a): F

A

F

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D, E, F, G>(ab, bc, cd, de, ef, fg): (…a) => G

Defined in: Composition/flow.ts:65

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

E

F

G

(…a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(…a): G

A

G

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D, E, F, G, H>(ab, bc, cd, de, ef, fg, gh): (…a) => H

Defined in: Composition/flow.ts:73

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

E

F

G

H

(…a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

(…a): H

A

H

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D, E, F, G, H, I>(ab, bc, cd, de, ef, fg, gh, hi): (…a) => I

Defined in: Composition/flow.ts:82

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

E

F

G

H

I

(…a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

(h) => I

(…a): I

A

I

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D, E, F, G, H, I, J>(ab, bc, cd, de, ef, fg, gh, hi, ij): (…a) => J

Defined in: Composition/flow.ts:92

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

E

F

G

H

I

J

(…a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

(h) => I

(i) => J

(…a): J

A

J

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation

flow<A, B, C, D, E, F, G, H, I, J, K>(ab, bc, cd, de, ef, fg, gh, hi, ij, jk): (…a) => K

Defined in: Composition/flow.ts:114

Composes functions from left to right, returning a new function. Unlike pipe, flow doesn’t take an initial value - it creates a reusable pipeline that can be called later with arguments.

Use flow when you want to create a named, reusable transformation. Use pipe when you want to immediately transform a value.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A extends readonly unknown[]

B

C

D

E

F

G

H

I

J

K

(…a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

(h) => I

(i) => J

(j) => K

(…a): K

A

K

// Create a reusable transformation
const processUser = flow(
  (user: User) => user.name,
  name => name.toUpperCase(),
  name => `Hello, ${name}!`
);

processUser({ name: "Alice" }); // "Hello, ALICE!"
processUser({ name: "Bob" }); // "Hello, BOB!"

// Compare with pipe (one-time use):
pipe(
  user,
  u => u.name,
  name => name.toUpperCase()
);

// flow creates a function, pipe applies immediately:
const double = flow((n: number) => n * 2);
double(5); // 10

pipe(5, n => n * 2); // 10 (immediate result)

pipe for immediate value transformation