Radash
  1. Curry
  2. chain

‚Äč
Basic usage

Chaining functions will cause them to execute one after another, passing the output from each function as the input to the next, returning the final output at the end of the chain.

import { chain } from 'radash'

const genesis = () => 0
const addFive = (num: number) => num + 5
const twoX = (num: number) => num * 2

const chained = chain(genesis, addFive, twoX)

chained() // => 10