Skip to content

converge

converge<A, B, C, R>(f, transformers): (a) => R

Defined in: Composition/converge.ts:18

Applies an input to several transformer functions independently, then passes all results to a combining function.

A

B

C

R

(b, c) => R

[(a) => B, (a) => C]

(a): R

A

R

const toNameRecord = converge(
  (trimmed: string, initials: string) => ({ trimmed, initials }),
  [
    (name: string) => name.trim(),
    (name: string) => name.split(" ").map((w) => w[0]).join(""),
  ],
);

toNameRecord("  Alice Bob  "); // { trimmed: "Alice Bob", initials: "AB" }

converge<A, B, C, D, R>(f, transformers): (a) => R

Defined in: Composition/converge.ts:22

Applies an input to several transformer functions independently, then passes all results to a combining function.

A

B

C

D

R

(b, c, d) => R

[(a) => B, (a) => C, (a) => D]

(a): R

A

R

const toNameRecord = converge(
  (trimmed: string, initials: string) => ({ trimmed, initials }),
  [
    (name: string) => name.trim(),
    (name: string) => name.split(" ").map((w) => w[0]).join(""),
  ],
);

toNameRecord("  Alice Bob  "); // { trimmed: "Alice Bob", initials: "AB" }

converge<A, B, C, D, E, R>(f, transformers): (a) => R

Defined in: Composition/converge.ts:26

Applies an input to several transformer functions independently, then passes all results to a combining function.

A

B

C

D

E

R

(b, c, d, e) => R

[(a) => B, (a) => C, (a) => D, (a) => E]

(a): R

A

R

const toNameRecord = converge(
  (trimmed: string, initials: string) => ({ trimmed, initials }),
  [
    (name: string) => name.trim(),
    (name: string) => name.split(" ").map((w) => w[0]).join(""),
  ],
);

toNameRecord("  Alice Bob  "); // { trimmed: "Alice Bob", initials: "AB" }