I am using Q in a Node.js application to implement promises and have something like this in which there is some promise chaining:
service.execute()
.then((result1) => {
return service2.execute(result1);
})
.then((result2) => {
//Here I need result1 and result2!!!
});
In the second then I need to use result1 from the previous then block but it isn't available. Is there a way to access it?
NOTE: There are similar questions but none of them solve the problem for Q library.