plainfp - v0.1.0
    Preparing search index...

    Function flow

    • Compose unary functions left-to-right into a new reusable function. Unlike pipe, flow defers execution — it returns a function awaiting input.

      Type Parameters

      • A
      • B

      Parameters

      • ab: (a: A) => B

      Returns (a: A) => B

      const normalizeEmail = flow(
      (s: string) => s.trim(),
      (s) => s.toLowerCase(),
      )
      normalizeEmail(" User@Example.COM ") // "user@example.com"
    • Compose unary functions left-to-right into a new reusable function. Unlike pipe, flow defers execution — it returns a function awaiting input.

      Type Parameters

      • A
      • B
      • C

      Parameters

      • ab: (a: A) => B
      • bc: (b: B) => C

      Returns (a: A) => C

      const normalizeEmail = flow(
      (s: string) => s.trim(),
      (s) => s.toLowerCase(),
      )
      normalizeEmail(" User@Example.COM ") // "user@example.com"
    • Compose unary functions left-to-right into a new reusable function. Unlike pipe, flow defers execution — it returns a function awaiting input.

      Type Parameters

      • A
      • B
      • C
      • D

      Parameters

      • ab: (a: A) => B
      • bc: (b: B) => C
      • cd: (c: C) => D

      Returns (a: A) => D

      const normalizeEmail = flow(
      (s: string) => s.trim(),
      (s) => s.toLowerCase(),
      )
      normalizeEmail(" User@Example.COM ") // "user@example.com"
    • Compose unary functions left-to-right into a new reusable function. Unlike pipe, flow defers execution — it returns a function awaiting input.

      Type Parameters

      • A
      • B
      • C
      • D
      • E

      Parameters

      • ab: (a: A) => B
      • bc: (b: B) => C
      • cd: (c: C) => D
      • de: (d: D) => E

      Returns (a: A) => E

      const normalizeEmail = flow(
      (s: string) => s.trim(),
      (s) => s.toLowerCase(),
      )
      normalizeEmail(" User@Example.COM ") // "user@example.com"
    • Compose unary functions left-to-right into a new reusable function. Unlike pipe, flow defers execution — it returns a function awaiting input.

      Type Parameters

      • A
      • B
      • C
      • D
      • E
      • F

      Parameters

      • ab: (a: A) => B
      • bc: (b: B) => C
      • cd: (c: C) => D
      • de: (d: D) => E
      • ef: (e: E) => F

      Returns (a: A) => F

      const normalizeEmail = flow(
      (s: string) => s.trim(),
      (s) => s.toLowerCase(),
      )
      normalizeEmail(" User@Example.COM ") // "user@example.com"