These are chat archives for ramda/ramda

Apr 2018
Brandon Chartier
Apr 16 2018 01:01
I think it would be more like compose(map(f), take(2)), which can be used as a transducer as well
Daniel Gray
Apr 16 2018 01:13
I have a value and an array of several Promise-returning functions I want to use with Promise.all, and I wanted to make a point-free function for it, but I can't figure out a way to do it cleanly, any ideas?
R.converge came to mind but I couldn't actually figure it out
Apr 16 2018 01:20
Apr 16 2018 01:21
Daniel Gray
Apr 16 2018 02:03
isn't that the same as f.then(g).then(h)? as in, they operate sequentially?
Apr 16 2018 02:09
Yes it would appear so
Syaiful Bahri
Apr 16 2018 02:17
@DanielFGray you need to bind Promise.all, ramda look like didn't have that functionality, so you maybe need R.bind, like const allP = R.bind(Promise.all, Promise)
or just use the native bind like Promise.all.bind(Promise). that way you can use it in compose or pipe.
Apr 16 2018 02:19
Looks like Ramda Adjunct has an allP
Syaiful Bahri
Apr 16 2018 02:23
but if you use Promise, using async function will be more readable than pointless style, ups i mean point-free style.
big watermelon
Apr 16 2018 08:38
Apr 16 2018 10:14
Can anyone give some repositories that well using ramda?
Sourav Chatterjee
Apr 16 2018 10:57
Hi Guys, I am doing vlidation of objects using R.where
Is it possible sing exisiting lib to also get error mesages against each validation?
Pedr Browne
Apr 16 2018 11:09

Can anyone give some repositories that well using ramda?

I'd also be very interested to see links to source of a non-trivial app or library that makes heavy use of Ramda.

Donavin Northrup
Apr 16 2018 13:47
    const separateEvery = (sep, n, xs) => R.unnest(R.intersperse([sep], R.splitEvery(n, xs)))

    const genElements = (totalSize, progress) => separateEvery(<DoneAll key={uid()}/>, 3, 
                          R.range(0, progress).map(() => <CheckCircle key={uid()} /> ), 
                          R.range(progress, 18).map(() => <CheckBoxOutline key={uid()} />)
I'm using numerous Ramda functions to output a grid of 18 'squares' and filling in the squares once per 'progress'. This is perfect, but I'm getting key warnings on DoneAll - seperateEvery seems to clone, so it clones the original Key over and over. Anyone have insight on refactoring this, or how to pass a truly unique key to the output of seperateEvery
Apr 16 2018 16:25
is there a simple way of using R.splitWhen() multiple times on an array. As it only performs a split once when the pred is true?
Mirza Brunjadze
Apr 16 2018 17:20
can anyone suggest reasonable name for function like this (on last line):
const keysFrom = {
  id: "any",
  name: "any"

const valuesFrom = {
  id: 1,
  name: "Truck",
  age: 22,
  otherJunk: true

R.pick(R.keys(keysFrom), valuesFrom) // {"id": 1, "name": "Truck"}
Mike Lambert
Apr 16 2018 17:21
naming thing is hard
how about pickKeysFrom
Mirza Brunjadze
Apr 16 2018 17:26
haha that's how it is named right now, but it kinda suggests that return value is "keys", or does it 🤔
pickByKeys looks better