We're a place where coders share, stay up-to-date and grow their careers.
Have you tried Ramda over Lodash? curry everything is so awesome, and everything is compossible
Lodash
const myFn = (input)=>{ const multiply = _.multiply(input, 2) const add = _.add(multiply, 1) const add = _.add(multiply, 1) return add < 0 ? add * -1 : add } myFn(-4) //=> 7
Ramda
const myFn = R.compose(Math.abs, R.add(1), R.multiply(2)) myFn(-4) //=> 7
Another Example Lodash
const myFn = (list)=> _.map(list, (n) => n * 2) myFn([4,8]) //=> [8, 32]
const myFn = R.map(R.multiply(2)) myFn([4,8]) //=> [8, 32]
I was recently looking into more functional paradigm and Ramda seems great. Hopefully I will have a chance to use it soon.
I’d also recommend trying rxjs! It’s simply awesome!
Have you tried Ramda over Lodash?
curry everything is so awesome, and everything is compossible
Lodash
Ramda
Another Example
Lodash
Ramda
I was recently looking into more functional paradigm and Ramda seems great. Hopefully I will have a chance to use it soon.
I’d also recommend trying rxjs! It’s simply awesome!