These are chat archives for ramda/ramda

Mar 2019
Mar 05 08:18

Could anyone possibly explain to me why the following returns undefined rather than what I expect {ref: 2, selected: true}?

const refs = {btts: {ref: 1, selected: false}, abc: {ref: 2, selected: true}}

find(r => r.selected, refs)

Rakesh Pai
Mar 05 08:19
find expects refs to be an array, but it's an object.
Mar 05 08:20
ahhh so unlike filter and map it doesn't work with objects?
Rakesh Pai
Mar 05 08:21
I didn't know filter and map work with objects. TIL. :)
Mar 05 08:22
Yea thats what confused me because I knew they did and then when I tried to use find it didn't :joy:
Thanks for clarifying though - really appreciate it.
Rakesh Pai
Mar 05 08:23
No problem.
Mike Chen
Mar 05 10:57
Hey all, Ramda is great! Just one question, why don't we add functions on cookbook to library?
Ben Briggs
Mar 05 19:33
@mike442144 I don't maintain Ramda but my guess is that it keeps the library more focused - not everyone is going to use or want every function from the cookbook but at least in my experience I use a lot of the main API surface. If you dig around in the issues a bit you may find this sentiment, e.g. &
Johnny Hauser
Mar 05 22:20
I'm possibly in dumb mode....
I have an array of arrays, and I need to zip the arrays together
R.reduce(, []) seems right to me
Brad Compton (he/him)
Mar 05 22:24
R.transpose :question:
Johnny Hauser
Mar 05 22:27
doh, yep
still seems like it would be a zip, though
reduce(pipe(zip, map(unnest)), head(data), tail(data))
Johnny Hauser
Mar 05 22:35
reduce(zipWith((a, b) => Array.isArray(a) ? [ ...a, b ] : [ a, b ]), head(data), tail(data))
but yeah, I will be using transpose. Thanks!