Pav*_*vel 0 asynchronous promise async-await typescript
我不能声明函数,它返回对Derivable 的承诺。原因如下:
interface Some {
then(callback);
}
// Error: the return type of an async function must either be a valid promise or must not contain a callable 'then' member.
async function foo(): Promise<Some> {
return null;
}
Run Code Online (Sandbox Code Playgroud)
这是打字稿中的错误吗?是否有任何解决方法?因此我不能使用 async/await。
归档时间: |
|
查看次数: |
1492 次 |
最近记录: |