-
-
Save xieranmaya/5f817d85823dcb108fc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.prototype.finally = function(fn) { | |
function finFn(){ | |
setTimeout(fn) | |
} | |
this.then(finFn, finFn) | |
return this | |
} |
PromiseHandle.catch().then(function() {
console.log('这里似乎等同于finally');
})
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
setTimeout 在这里起什么作用?