I am very new to Ramda and have got stuck in a problem. I need to get response from an api and pass it to next function but that same response needs to be used again at a later stage in the same compose. How can I save its value in that ramda func scope so it can be re-used again?
const getData = (req, ctx) => R.compose
(
R.andThen(... do some action using response from callSomeApi_2 and prop2)
, R.andThen(callSomeApi_2(req, ctx))
, R.andThen(R.map(R.prop('prop1'))) // response has prop1 and prop2 where prop2 is needed after getting response from callSomeApi_2
, callSomeApi_1(req, ctx)
);
How can this be achieved?