You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
437 B
20 lines
437 B
/**
|
|
* @this {Promise}
|
|
*/
|
|
function finallyConstructor(callback) {
|
|
var constructor = this.constructor;
|
|
return this.then(
|
|
function(value) {
|
|
return constructor.resolve(callback()).then(function() {
|
|
return value;
|
|
});
|
|
},
|
|
function(reason) {
|
|
return constructor.resolve(callback()).then(function() {
|
|
return constructor.reject(reason);
|
|
});
|
|
}
|
|
);
|
|
}
|
|
|
|
export default finallyConstructor;
|
|
|