Share your code. Components are building blocks, you are the architect.

utils/reduced
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns a value wrapped to indicate that it is the final value of the reduce

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/reduced in your project
npm i @bit/bit.ramda.utils.reduced
Copied

reduced (x:*) : *

Returns a value wrapped to indicate that it is the final value of the reduce and transduce functions. The returned value should be considered a black box: the internal structure is not guaranteed to be stable.

Note: this optimization is unavailable to functions not explicitly listed above. For instance, it is not currently supported by reduceRight.

Example

R.reduce(
      (acc, item) => item > 3 ? R.reduced(acc) : acc.concat(item),
      [],
      [1, 2, 3, 4, 5]) // [1, 2, 3]

Argument

x: *

The final value of the reduce.

Returns

*

The wrapped value.