Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

function-composition

nbeach174MIT1.0.12TypeScript support: included

A library for readable composing/chaining of function calls

functional, chain, compose, function

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