source: node_modules/ramda-adjunct/es/curryRight.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: 858 bytes
Line 
1import { converge, length, identity } from 'ramda';
2import curryRightN from './curryRightN';
3
4/**
5 * Returns a curried equivalent of the provided function.
6 * This function is like curry, except that the provided arguments order is reversed.
7 *
8 * @func curryRight
9 * @memberOf RA
10 * @since {@link https://char0n.github.io/ramda-adjunct/1.12.0|v1.12.0}
11 * @category Function
12 * @sig (* -> a) -> (* -> a)
13 * @param {Function} fn The function to curry
14 * @return {Function} A new, curried function
15 * @see {@link http://ramdajs.com/docs/#curry|R.curry}, {@link RA.curryRightN|curryRightN}
16 * @example
17 *
18 * const concatStrings = (a, b, c) => a + b + c;
19 * const concatStringsCurried = RA.curryRight(concatStrings);
20 *
21 * concatStringCurried('a')('b')('c'); // => 'cba'
22 */
23var curryRight = converge(curryRightN, [length, identity]);
24export default curryRight;
Note: See TracBrowser for help on using the repository browser.