These are chat archives for ramda/ramda

Mar 2018
Mar 30 2018 01:03
@GantMan pretty good. I also did it like this....
const c = R.compose(
  R.flatten,  // handles any number of array nestings

const cb = e => c(e);
const f = R.reject(cb);
Pedr Browne
Mar 30 2018 10:39
How do people deal with situations where you need to get a configuration value (one that is only known at runtime) into functions that are a long way from the point where the configuration is defined? I find myself using closure a lot - defining functions where I have a config obj in scope so either they have access to it via closure or so I can partially apply the part(s) of the config I want to those functions. Is there a better way?
Matthew Willhite
Mar 30 2018 15:21
@Undistraction I believe you want a Reader
Brad Compton (he/him)
Mar 30 2018 16:43
Hi @BipinBhandari, welcome! You can always use something like reduce to do this, here I've used R.reduced to short circuit once an error is found:
The down side is that you end up running the failing validation function twice
Though that's a minor concern, I know some people don't like it
Pedr Browne
Mar 30 2018 17:01
@miwillhite Thanks. That is exactly what I want.
Bipin Bhandari
Mar 30 2018 17:37
@Bradcomp Thanks a lot!
Anthony Palmer
Mar 30 2018 23:20

Hey there, if someone could help me debug this issue I'd appreciate it.

  const members = R.pipe(
    R.pathOr({}, ['channels', channelID, 'members']),
    R.reject(R.equals('a key')),

Typescript is giving me a compile error on the R.reject line, saying I cant assign a string[] to a Dictionary<string>.

After looking at this for a while I realized I could do the same thing I wanted by swapping out reject for without but I'm curious as to whats keeping this from working.

Why wouldnt reject be able to operate on an array of strings?