Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是否正确理解我不需要在 TypeScript 中使用 tj/co 之类的库来控制流程,因为我可以使用 async/await?使用带有生成器的 Promise 只是 async/await 的一种解决方法?
我不需要在 TypeScript 中使用 tj/co 之类的库来控制流程,因为我可以使用 async/await?
是的。
使用带有生成器的 Promise 只是 async/await 的一种解决方法?
是的。在 ES6 中使用生成器和异步运行器来模拟async/await并获得每个人都渴望的语法糖。现在有了 ES8,你可以await直接做出承诺。
async
await