我很困惑为什么我需要在另一个函数中再次运行异步/等待
示例
async function fetchData() {
try {
const result = await axios.get('http://example.com')
return result
} catch(err) {
return err
}
}
// and in another function I need to async await again
// if I want to get the value of f
我想根据初始API调用的响应使用axios进行API调用--异步函数可以这样做吗? 我已经尝试了以下内容,使用await/promise: function get_user(value){
return axios.get( "https://apicall/" + value )
}
function get_user_posts(username){
return axios.get("https://apicall/" + username)
}
var UsersOutput = async function () {
const u