Skip to content

compose

Create a function that composes multiple functions together. In a composition of functions, each function is given the next function as an argument and must call it to continue executing.

Usage

const myComposedFunc = compose(
(x) => x + 5,
(x) => x * 2,
);
myComposedFunc(0); // => 5

Installation

Terminal window
npx atmx add helper compose