source: node_modules/ramda-adjunct/src/dropArgs.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: 661 bytes
Line 
1import { nAry } from 'ramda';
2
3/**
4 * Accepts a function with any arity and returns a function with arity of zero.
5 * The returned function ignores any arguments supplied to it.
6 *
7 * @func dropArgs
8 * @memberOf RA
9 * @since {@link https://char0n.github.io/ramda-adjunct/2.10.0|v2.10.0}
10 * @category Logic
11 * @sig (...a -> b)-> () -> b
12 * @param {Function} fn The function with any arity
13 * @return {Function} Returns function with arity of zero
14 * @see {@link http://ramdajs.com/docs/#nAry|R.nAry}
15 * @example
16 *
17 * const fn = (a = 1, b = 2) => a + b;
18 *
19 * RA.dropArgs(fn)('ignore1', 'ignore2'); //=> 3
20 */
21const dropArgs = nAry(0);
22
23export default dropArgs;
Note: See TracBrowser for help on using the repository browser.