Files
VUE_GabenParadise/node_modules/promise-polyfill/src/finally.js
2020-08-10 14:35:19 +02:00

24 lines
499 B
JavaScript

/**
* @this {Promise}
*/
function finallyConstructor(callback) {
var constructor = this.constructor;
return this.then(
function(value) {
// @ts-ignore
return constructor.resolve(callback()).then(function() {
return value;
});
},
function(reason) {
// @ts-ignore
return constructor.resolve(callback()).then(function() {
// @ts-ignore
return constructor.reject(reason);
});
}
);
}
export default finallyConstructor;