source: node_modules/ramda/es/juxt.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 813 bytes
RevLine 
[d24f17c]1import _curry1 from "./internal/_curry1.js";
2import converge from "./converge.js";
3/**
4 * juxt applies a list of functions to a list of values.
5 *
6 * @func
7 * @memberOf R
8 * @since v0.19.0
9 * @category Function
10 * @sig [(a, b, ..., m) -> n] -> ((a, b, ..., m) -> [n])
11 * @param {Array} fns An array of functions
12 * @return {Function} A function that returns a list of values after applying each of the original `fns` to its parameters.
13 * @see R.applySpec
14 * @example
15 *
16 * const getRange = R.juxt([Math.min, Math.max]);
17 * getRange(3, 4, 9, -3); //=> [-3, 9]
18 * @symb R.juxt([f, g, h])(a, b) = [f(a, b), g(a, b), h(a, b)]
19 */
20
21var juxt =
22/*#__PURE__*/
23_curry1(function juxt(fns) {
24 return converge(function () {
25 return Array.prototype.slice.call(arguments, 0);
26 }, fns);
27});
28
29export default juxt;
Note: See TracBrowser for help on using the repository browser.