These are chat archives for ramda/ramda

4th
Jul 2018
Mateusz
@kulek_gitlab
Jul 04 2018 06:54

Hi guys, how can I get rid of arrow function in the code like this?

const sumItemsPriceByProp = (e) => items =>
  R.pipe(
    R.map(R.prop(e)),
    R.sum,
    formatPrice,
  )(items);

const getItemsByNetPrice = R.curry(sumItemsPriceByProp('price'));

// and then:
getItemsByNetPrice(items);

My main obstacle is passing e argument to R.map(R.prop)) . To be more clear: price string (as e argument) is passing to R.map(R.prop(e)) right now