@typed/reduce
v1.0.1
Published
Well-typed reduction
Downloads
3
Readme
@typed/reduce
Well-typed Reduce function
Reduce over arrays and array-like items.
Let me have it!
npm install --save @typed/reduce
# or
yarn add @typed/reduce
Basic usage
import { reduce } from '@typed/reduce';
const sum = (x: number, y: number) => x + y;
const reduceSum = reduce(sum);
const reduceSumFromZero = reduceSum(0);
console.log(reduceSumFromZero([1, 2, 3])) // 6