Whats the purpose of typescript's __awaiter

前端 未结 1 1608
自闭症患者
自闭症患者 2021-02-19 00:59

consider this simple class

class Test {
    private foo(): Promise {
        return new Promise((resolve, reject) => {
            res         


        
1条回答
  •  情话喂你
    2021-02-19 01:11

    Typescript includes the __awaiter helper because async/await is not a part of the es6/es2015 specification.

    Initial definition in ES2017. -- MDN

    If you don't want to include this helper, you need to target es2017.

    0 讨论(0)
提交回复
热议问题