A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.
A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.
A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.
A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.
A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.
A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.
A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.
A function that accepts the first input and returns the final result.
import { flow } from '@pacote/pipe'
const doubleSay = (value: string) => `${value}, ${value}`
const capitalize = (value: string) =>
value.charAt(0).toUpperCase() + value.slice(1)
const exclaim = (value: string) => `${value}!`
const transform = flow(doubleSay, capitalize, exclaim)
transform('hello') // => 'Hello, hello!'
// equivalent to (value) => exclaim(capitalize(doubleSay(value)))
Composes functions into a new function that applies them from left to right.