技术使用:React,Redux,Saga从第二个函数调用之后,如何访问数据? firstFunction继续执行其余代码。我尝试了async / await,但是它不起作用。
firstFunction (()=>{
secondFunctionAPI() //using Redux and Saga
// Here I want to use the data from the response of secondFunction().
more code...
more code..
})
您可以将要执行的代码作为回调传递给secondFunctionAPI
firstFunction(() => {
secondFunctionAPI((data) => {
// code using data
})
})