add finally polyfill for promises
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
import 'core-js/es6/promise';
|
||||
|
||||
// default promise polyfill doesn't include finally
|
||||
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;
|
||||
|
||||
export default function loadPolyfills() {
|
||||
const fillCoreJs = () => {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user