source: node_modules/ramda/es/partial.js

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: 1.2 KB
Line 
1import _concat from "./internal/_concat.js";
2import _createPartialApplicator from "./internal/_createPartialApplicator.js";
3/**
4 * Takes a function `f` and a list of arguments, and returns a function `g`.
5 * When applied, `g` returns the result of applying `f` to the arguments
6 * provided initially followed by the arguments provided to `g`.
7 *
8 * @func
9 * @memberOf R
10 * @since v0.10.0
11 * @category Function
12 * @sig ((a, b, c, ..., n) -> x) -> [a, b, c, ...] -> ((d, e, f, ..., n) -> x)
13 * @param {Function} f
14 * @param {Array} args
15 * @return {Function}
16 * @see R.partialRight, R.curry
17 * @example
18 *
19 * const multiply2 = (a, b) => a * b;
20 * const double = R.partial(multiply2, [2]);
21 * double(3); //=> 6
22 *
23 * const greet = (salutation, title, firstName, lastName) =>
24 * salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';
25 *
26 * const sayHello = R.partial(greet, ['Hello']);
27 * const sayHelloToMs = R.partial(sayHello, ['Ms.']);
28 * sayHelloToMs('Jane', 'Jones'); //=> 'Hello, Ms. Jane Jones!'
29 * @symb R.partial(f, [a, b])(c, d) = f(a, b, c, d)
30 */
31
32var partial =
33/*#__PURE__*/
34_createPartialApplicator(_concat);
35
36export default partial;
Note: See TracBrowser for help on using the repository browser.