Type alias Reducer<Item, Accumulator>

Reducer<Item, Accumulator>: Unary<Item, Unary<Accumulator, Accumulator>>

Reducer/Folder function.

Remarks

Type to represent a folder/reducer unary function that takes an item and an accumulator something of the type of the accumulator.

Example

const reducer: Reducer<number, number> = item => accumulator => accumulator + item;

See

Unary

Type Parameters

  • Item

    Type of the items to reduce.

  • Accumulator

    Type of the accumulator/output.