function-composition
v1.0.12
Published
A library for readable composing/chaining of function calls
Downloads
362
Maintainers
Readme
FunctionComposition
A library for readable composing/chaining of function calls.
Usage
import {first} from "function-composition";
const addFive = (num: number) => num + 5;
const isTen = (num: number) => num === 10;
const toString = (val: number | boolean | string) => String(val);
const result = first(addFive)
.then(isTen)
.then(toString)
.apply(2);