main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
992 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import _curry1 from "./internal/_curry1.js";
|
---|
| 2 | import _reduced from "./internal/_reduced.js";
|
---|
| 3 | /**
|
---|
| 4 | * Returns a value wrapped to indicate that it is the final value of the reduce
|
---|
| 5 | * and transduce functions. The returned value should be considered a black
|
---|
| 6 | * box: the internal structure is not guaranteed to be stable.
|
---|
| 7 | *
|
---|
| 8 | * This optimization is available to the below functions:
|
---|
| 9 | * - [`reduce`](#reduce)
|
---|
| 10 | * - [`reduceWhile`](#reduceWhile)
|
---|
| 11 | * - [`reduceBy`](#reduceBy)
|
---|
| 12 | * - [`reduceRight`](#reduceRight)
|
---|
| 13 | * - [`transduce`](#transduce)
|
---|
| 14 | *
|
---|
| 15 | * @func
|
---|
| 16 | * @memberOf R
|
---|
| 17 | * @since v0.15.0
|
---|
| 18 | * @category List
|
---|
| 19 | * @sig a -> *
|
---|
| 20 | * @param {*} x The final value of the reduce.
|
---|
| 21 | * @return {*} The wrapped value.
|
---|
| 22 | * @see R.reduce, R.reduceWhile, R.reduceBy, R.reduceRight, R.transduce
|
---|
| 23 | * @example
|
---|
| 24 | *
|
---|
| 25 | * R.reduce(
|
---|
| 26 | * (acc, item) => item > 3 ? R.reduced(acc) : acc.concat(item),
|
---|
| 27 | * [],
|
---|
| 28 | * [1, 2, 3, 4, 5]) // [1, 2, 3]
|
---|
| 29 | */
|
---|
| 30 |
|
---|
| 31 | var reduced =
|
---|
| 32 | /*#__PURE__*/
|
---|
| 33 | _curry1(_reduced);
|
---|
| 34 |
|
---|
| 35 | export default reduced; |
---|
Note:
See
TracBrowser
for help on using the repository browser.