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 (
|
||||
|
||||
Generated
+2887
-2886
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -44,7 +44,9 @@
|
||||
"bem-react-helper": "^1.1.2",
|
||||
"preact": "^8.2.9"
|
||||
},
|
||||
"eslintIgnore": ["public"],
|
||||
"eslintIgnore": [
|
||||
"public"
|
||||
],
|
||||
"jest": {
|
||||
"transform": {
|
||||
"^.+\\.jsx?$": "<rootDir>/fileTransformer.js"
|
||||
|
||||
Reference in New Issue
Block a user