Skip to main content

Type Alias: RawOptionalReducerWithoutFinish<Value, This>

RawOptionalReducerWithoutFinish<Value, This> = object

Defined in: reducers.d.ts:60

A reducer that reduces by combining pairs of values using RawOptionalReducerWithoutFinish.add.

Example​

import { or, pipe, reduce } from 'lfi'

console.log(
pipe(
[1, 2, 3, 4],
reduce(
// This is a `RawOptionalReducerWithoutFinish`
{
add: (number1, number2) => number1 + number2,
},
),
or(() => 0),
),
)
//=> 10
Playground

Since​

v2.0.0

Type Parameters​

Value​

Value = unknown

This​

This = unknown

Properties​

add()​

add: (this, acc, value) => Value

Defined in: reducers.d.ts:61

Parameters​

this​

This

acc​

Value

value​

Value

Returns​

Value