相关疑难解决方法(0)

一起使用 async await 和 .then

使用async/await.then().catch()一起使用是否有任何危害,例如:

async apiCall(params) {
    var results = await this.anotherCall()
      .then(results => {
        //do any results transformations
        return results;
      })
      .catch(error => {
        //handle any errors here
      });
    return results;
  }
Run Code Online (Sandbox Code Playgroud)

javascript asynchronous node.js promise async-await

33
推荐指数
6
解决办法
3万
查看次数

标签 统计

async-await ×1

asynchronous ×1

javascript ×1

node.js ×1

promise ×1