I am trying to better understand functional composition in ramda.js and currently have a method in a class that looks like this:
const replace = (newItem) => function3(function1(newItem).function2(newItem));
I know in ramda.js for a simpler function like
const replace = (newItem) => function2(function1(newItem));
you could write it like
const replace = compose(function2, function1);
Is there a similar way to do the same with the initial function using functional composition / application or other ramda.js helper methods?
newItemargument is really much harder in point-free style. Don't try it.R.compose(function3, R.converge(R.call, [R.compose(R.flip(R.invoker(1,'function2')), function1), R.identity]))is not acceptable from a maintenance standpoint. It also increases the number of function calls an absurd amount.