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