Function flow

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • R

    Parameters

    • f1: ((_) => R)
        • (_): R
        • Parameters

          • _: I

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => R)
        • (_): R
        • Parameters

          • _: A1

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => R)
        • (_): R
        • Parameters

          • _: A2

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • A3

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => A3)
        • (_): A3
        • Parameters

          • _: A2

          Returns A3

    • f4: ((_) => R)
        • (_): R
        • Parameters

          • _: A3

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • A3

    • A4

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => A3)
        • (_): A3
        • Parameters

          • _: A2

          Returns A3

    • f4: ((_) => A4)
        • (_): A4
        • Parameters

          • _: A3

          Returns A4

    • f5: ((_) => R)
        • (_): R
        • Parameters

          • _: A4

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • A3

    • A4

    • A5

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => A3)
        • (_): A3
        • Parameters

          • _: A2

          Returns A3

    • f4: ((_) => A4)
        • (_): A4
        • Parameters

          • _: A3

          Returns A4

    • f5: ((_) => A5)
        • (_): A5
        • Parameters

          • _: A4

          Returns A5

    • f6: ((_) => R)
        • (_): R
        • Parameters

          • _: A5

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • A3

    • A4

    • A5

    • A6

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => A3)
        • (_): A3
        • Parameters

          • _: A2

          Returns A3

    • f4: ((_) => A4)
        • (_): A4
        • Parameters

          • _: A3

          Returns A4

    • f5: ((_) => A5)
        • (_): A5
        • Parameters

          • _: A4

          Returns A5

    • f6: ((_) => A6)
        • (_): A6
        • Parameters

          • _: A5

          Returns A6

    • f7: ((_) => R)
        • (_): R
        • Parameters

          • _: A6

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • A3

    • A4

    • A5

    • A6

    • A7

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => A3)
        • (_): A3
        • Parameters

          • _: A2

          Returns A3

    • f4: ((_) => A4)
        • (_): A4
        • Parameters

          • _: A3

          Returns A4

    • f5: ((_) => A5)
        • (_): A5
        • Parameters

          • _: A4

          Returns A5

    • f6: ((_) => A6)
        • (_): A6
        • Parameters

          • _: A5

          Returns A6

    • f7: ((_) => A7)
        • (_): A7
        • Parameters

          • _: A6

          Returns A7

    • f8: ((_) => R)
        • (_): R
        • Parameters

          • _: A7

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • A3

    • A4

    • A5

    • A6

    • A7

    • A8

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => A3)
        • (_): A3
        • Parameters

          • _: A2

          Returns A3

    • f4: ((_) => A4)
        • (_): A4
        • Parameters

          • _: A3

          Returns A4

    • f5: ((_) => A5)
        • (_): A5
        • Parameters

          • _: A4

          Returns A5

    • f6: ((_) => A6)
        • (_): A6
        • Parameters

          • _: A5

          Returns A6

    • f7: ((_) => A7)
        • (_): A7
        • Parameters

          • _: A6

          Returns A7

    • f8: ((_) => A8)
        • (_): A8
        • Parameters

          • _: A7

          Returns A8

    • f9: ((_) => R)
        • (_): R
        • Parameters

          • _: A8

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

  • Takes functions and builds a function which consecutively calls each given function with a result from a previous one. Similar to Opt.pipe, but doesn't take input directly, instead returns a function which can be called repeatedly with different inputs.

    flow( // 1. 63
    add1, // 2. 64
    Math.sqrt, // 3. 8
    )(63), // 4. 8

    // gives same result as
    Math.sqrt(add1(63)) // 8
    const f = flow(add1, Math.sqrt); // (_: number) => number
    f(63); // 8
    f(3); // 2

    Type Parameters

    • I

    • A1

    • A2

    • A3

    • A4

    • A5

    • A6

    • A7

    • A8

    • A9

    • R

    Parameters

    • f1: ((_) => A1)
        • (_): A1
        • Parameters

          • _: I

          Returns A1

    • f2: ((_) => A2)
        • (_): A2
        • Parameters

          • _: A1

          Returns A2

    • f3: ((_) => A3)
        • (_): A3
        • Parameters

          • _: A2

          Returns A3

    • f4: ((_) => A4)
        • (_): A4
        • Parameters

          • _: A3

          Returns A4

    • f5: ((_) => A5)
        • (_): A5
        • Parameters

          • _: A4

          Returns A5

    • f6: ((_) => A6)
        • (_): A6
        • Parameters

          • _: A5

          Returns A6

    • f7: ((_) => A7)
        • (_): A7
        • Parameters

          • _: A6

          Returns A7

    • f8: ((_) => A8)
        • (_): A8
        • Parameters

          • _: A7

          Returns A8

    • f9: ((_) => A9)
        • (_): A9
        • Parameters

          • _: A8

          Returns A9

    • f10: ((_) => R)
        • (_): R
        • Parameters

          • _: A9

          Returns R

    Returns ((x) => R)

      • (x): R
      • Parameters

        • x: I

        Returns R

Generated using TypeDoc