3 ms·
I wouldn't recommend mixing those two libraries as they often do _very_ different things with the same name (eg. `chain` in ramda is `flatMap`) but also because
by adregan 7y ago
I wouldn't recommend mixing those two libraries as they often do _very_ different things with the same name (eg. `chain` in ramda is `flatMap`) but also because ramda mostly flips the arguments of most functions.
For example, `map` takes the function first and then the collection. That's handy because everything is curried so you can partially apply map:
const double = R.map(x => x * 2);
and can build up helper functions. Something similar in lodash would be:
const double = (collection) => _.map(collection, x => x * 2);
which there is nothing wrong with, it's just that the first is more ergonomic with `pipe` (and the potential future feature pipeline operator `|>`).
That said, it took a while to adopt at work. It wasn't until we had a critical mass of people who enjoyed functional programming that it really took off. Before that time, we used a few methods lightly (utils like `pathOr` and `propOr` are so nice when you want to safely traverse an object without `o && o.foo && o.foo.bar`) and were very conscious that it might not be everyone's cup of tea.