use es7/promise polyfill instead of es6 for finally support (#147)
closes #122
This commit is contained in:
committed by
Aleksei Gurianov
parent
0ee7a6940a
commit
31cca0146f
@@ -1,16 +1,4 @@
|
||||
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;
|
||||
import 'core-js/es7/promise';
|
||||
|
||||
export default function loadPolyfills() {
|
||||
const fillCoreJs = () => {
|
||||
|
||||
Reference in New Issue
Block a user