source: node_modules/ramda/src/juxt.js@ 65b6638

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

Initial commit

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