简体   繁体   中英

Babel-polyfill Promises and “finally” support

如果我在React-Redux堆栈的项目构建中使用babel-polyfill ,如何启用finally方法支持

Actually, now it has a proposal , and it's recently got into Stage-3, WebKit already supports it . Spec compliant shim/polyfill libraries are already available too. We can expect an update from the Promise polyfill library maintainers also.

I believe, the Babel-Polyfill shim uses core-js under the hood, which does support Promise.finally: https://github.com/zloirock/core-js#commonjs

在此输入图像描述

The ES6 standard does not support the finally phase of a promise, as TJ Crowder mentioned in the comments to your question. If you want that kind of support, you might look into promises from a library like RSVP .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM