Utility Library (comparable to Lodash, Underscore)
pure functions, immutable state
AND:
Every function is curried by default
data to operate on comes last
CurrYING
apply parameters of a function in several calls
Goal: have unary functions
// A normal function with two arguments
const myFunction = (param1, param2) => { console.log(`I got called with ${param1} ${param2}` };
myFunction('Hello', 'World') // I got called with Hello World
// Now lets curry it
import {curry} from 'ramda';
const myCurriedFunction = curry(myFunction);
// does NOT execute the function, but stores the first arugment
const myCurriedHelloFunction = myCurriedFunction('Hello');
// ... do other things and then later
myCurriedHellFunction('World') // now prints 'I got called with Hello World');