These are chat archives for ramda/ramda

Sep 2018
Pedro Ávila
Sep 23 2018 00:33
@joeyfigaro here's another way if you find more readable:
const obj1 = {}
const obj2 = { email: '' }

compose (prop ('email'), head, reject (isEmpty)) ([obj1, obj2])
// => ""
Johnny Hauser
Sep 23 2018 15:29
I apologize that I asked something like this ages ago, and didn't understand the response and am also not sure if I asked the question well. I am revisiting the subject and still don't have a grasp on where to begin. It's about unwrapping values deeply. Here are the notes I wrote to myself about it:
const nestedStream = Stream(Stream(Stream()))
const nestedObject = { a: { b: { c: {} } }
nestedObject.c = nestedStream
// should the result be:
// { a: { b: { c: 123 } } }
// or
// { a: { b: { c: Stream(Stream(123)) }
that extractCollectionDeep function should probably not exist, is the point
I think there are fp ways of dealing with that kind of problem generically and expressively, but I don't know how to get there.
I might also be suffering some confusion from having two kinds of nesting going on: JS Primitive object nesting and Stream functor nesting