Jordan Harband 提出了 Promise.prototype.finally 这一章节的提案。 如何工作? .finally() 这样用: promise .then(result => {···}) .catch(error => {···}) .finally(() => {···}); finally 的回调总是会被执行。作为比较: then 的回调只有当 promise 为 f…
Jordan Harband 提出了 Promise.prototype.finally 这一章节的提案。 如何工作? .finally() 这样用: promise .then(result => {···}) .catch(error => {···}) .finally(() => {···}); finally 的回调总是会被执行。作为比较: then 的回调只有当 promise 为 f…
讨论
登录后参与讨论
还没有评论,来说第一句吧。