re: My React stack for 2019 VIEW POST

FULL DISCUSSION
 

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]

Ramda

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!

code of conduct - report abuse