在变量上使用.then()函数?

我有一个包含函数的变量:

let handler: () => Promise<string> = HTTP_REQUEST();

为什么我不能打电话.then()handler

例子:

handler.then(...)

回答

你走在正确的轨道上。变量包含一个函数。请执行下列操作

handler().then(...)


以上是在变量上使用.then()函数?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>