Aug 31, 2018 · 1 min read
Hi, I want to know, is the following code correct that implements finally?
Promise.prototype.finally = function(fn) {
return this.then(val => {
fn();
return val;
}, val => {
fn();
return Promise.reject(val);
})
}Thanks~
