Files
remark42/web/app/common/promises.js
T

13 lines
329 B
JavaScript

import Promise from 'promise-polyfill';
Promise.prototype.finally = function finallyFn(callback) {
const constructor = this.constructor;
return this.then(
(value) => constructor.resolve(callback()).then(() => value),
(reason) => constructor.resolve(callback()).then(() => reason)
);
};
window.Promise = Promise;