function-composition
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

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);

Package Sidebar

Install

npm i function-composition

Weekly Downloads

43

Version

1.0.12

License

MIT

Unpacked Size

4.98 kB

Total Files

9

Last publish

Collaborators

  • tachyon5k