Message from JavaScript discussions

March 2019

— Ramda question here:
Is any fn like this?
fn1 => fn2 => (…a) => fn1(fn2(…a))

— 

I’m just trying to shorten this:

const xs = [{id: 1}, {id: 2}, {id: 3}];
const fn = R.compose(
R.not,
R.curry(
R.flip(
R.uncurryN(
2,
R.compose(
R.find,
R.propEq('id'),
R.prop('id')
)
)
)
)
)

fn(xs, {id: 2}) // -> false

— This is compose

— Do you really need all that curry / uncurry stuff?

— Can you give a description of what fn should do?

— I realized that later

— I think so, I tried to apply flip to find directly but for some reason doesn’t work.

— This

— There's probably something way simpler for your case

— Yes, given a list of objects find if an object id is in the ids of the objects. And return false if found.

Message permanent page

— What to return if not found?

— True