对于空函数的用途是什么,然后第二个参数(promise.then)?
我在大项目中找到一些代码:
const handlePay = () => {
someFunction()
.then(unwrapResult)
.then(
() => history.push(
authorizedRoutes.accruals.payment.link
),
() => {} /* what is it??? */
);
我不明白此代码的内容:()=> {}
I find in big project some code:
const handlePay = () => {
someFunction()
.then(unwrapResult)
.then(
() => history.push(
authorizedRoutes.accruals.payment.link
),
() => {} /* what is it??? */
);
I dont understand for what this code: () => {}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个更仔细的查看
then()
它的reccept
https://developer.mozilla.org/de/docs/web/javascript/reference/global_objects/promise/promise/then
Here is a closer look at
.then()
Its the reject
https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise/then