Skip to content

chain

Create a function that chains multiple functions together. The functions are called in order. Each function takes the result of the previous function as its first argument.

Usage

const myChainedFunc = chain(
(x) => x + 5,
(x) => x * 2,
);
myChainedFunc(0); // => 10

Installation

Terminal window
npx atmx add helper chain