finally-polyfill
A tiny ~150-byte polyfill for Promise.prototype.finally
.
Useful for browsers that support Promise but not the .finally()
method.
Usage
npm install finally-polyfill
It's a polyfill, so you can import
, require()
or drop it in a script tag - all the same.
import 'finally-polyfill';
Promise.reject('oops').finally(() => { /* ... */ })
<script src="/path/to/finally-polyfill.min.js"></script>
License
MIT
If you use create-react-app or similar tool (with browserlists config
ie: 11
), babel will do this transform for you