I have a promise chain like so
functionOne()
.catch(errorHandlerOne)
.then(functionTwo) // calls functionTwo(responseOne)
.catch(errorHandlerTwo)
.then(functionThree) // calls functionThree(responseTwo)
.catch(errorHandlerThree)
.finally(finalHandler)
This might seem to be an obvious answer, but my question is this:
I can access the responseOne
in functionTwo()
fine, but how can I access the responseOne
in functionThree()
or finalHandler()
?
Edit: I thought about assigning it to a variable and accessing it later, but it seems to be quite hacky and against the flow of the promise chain. I'm looking for a better way