These are chat archives for ramda/ramda

29th
Apr 2018
Eduardo Díaz
@edjroz
Apr 29 2018 04:08
i figured it out
it turns out R.props doesn't throw an error
therefore the catcher function is never executed returning undefined
Pedr Browne
@Undistraction
Apr 29 2018 10:56
I need to add some functions as props to a function. I know that sounds gross, but it is necessary for a compact public api: so users can do api() or api.alpha(), api.bravo(). I have the function and an object map with each function keyed. Does Ramda offer a way of merging this object with the function? All the R.merge functions return a new object (understandably), meaning the function is replaced by the new object. Obviously I can do this with vanilla JS, but I'm wondering if there is a way to do this with Ramda:
const f = () => {}
const o = {
   alpha: f1,
   bravo: f2,
   charlie: f3,
}
// How can i merge this object with `f`?
PeckZeg
@PeckZeg
Apr 29 2018 14:59
@Undistraction R.merge is a immutable function, so the result you need, i think it is difficult to write with ramda.