How to use the unary function from ramda

Find comprehensive JavaScript ramda.unary code examples handpicked from public code repositorys.

8
9
10
11
12
13
14
15
16
17
18
19
const SEPARATOR = `${EOL}${revealOpt.separator}${EOL}`;
const SLIDES_PATH = join(__dirname, './slides.md');


const isMdFile = name => name.includes('.md');
const folders = pipe(
    unary(readdirSync),
    reject(isMdFile)
);


const makeVerticalSliders = src => {
fork icon4
star icon5
watch icon0

4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
*        return [a, b];
*      };
*      takesTwoArgs.length; //=> 2
*      takesTwoArgs(1, 2); //=> [1, 2]
*
*      var takesOneArg = R.unary(takesTwoArgs);
*      takesOneArg.length; //=> 1
*      // Only 1 argument is passed to the wrapped function
*      takesOneArg(1, 2); //=> [1, undefined]
*/
fork icon0
star icon0
watch icon0

+ 17 other calls in file

5
6
7
8
9
10
11
12
13
14
15
16
17
18


const resolve = Promise.resolve.bind(Promise);


const reject = Promise.reject.bind(Promise);


const serialize = R.unary(JSON.stringify);
const deserialize = R.unary(JSON.parse);


const deserializeCacheValue = R.ifElse(
  R.not,
fork icon0
star icon0
watch icon0

14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
 *
 *      const takesOneArg = R.unary(takesTwoArgs);
 *      takesOneArg.length; //=> 1
 *      // Only 1 argument is passed to the wrapped function
 *      takesOneArg(1, 2); //=> [1, undefined]
 * @symb R.unary(f)(a, b, c) = f(a)
 */




var unary =
fork icon0
star icon0
watch icon2

+ 7 other calls in file

8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 20






// unary | (a → b → c → … → z) → (a → z)
const maxFromUnity = R.unary(Math.max)
maxFromUnity(10, 20, 30, 40)
// 10



fork icon0
star icon0
watch icon0

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)