her-promise
v0.1.2
Published
This is a polyfill of the ES6/ES9/ES11/ES12 Promise.
Downloads
55
Maintainers
Readme
her-promise
This is a polyfill of the ES6/ES9/ES11/ES12 Promise.
Install
npm:
$ npm install --save her-promise
yarn:
$ yarn add her-promise
Browser
<script src="her-promise.js"></script>
Usage
Using in code
Using in browser
<script>
new Promise((resolve, reject) => {
reject();
}).finally(() => {
// ...
});
Promise.race([
// ...
]).then(() => {
// ...
});
Promise.allSettled([
// ...
]).then(() => {
// ...
});
Promise.any([
// ...
]).then(() => {
// ...
});
</script>
Using in es6 or typescript
// You can import in entry file at first
import 'her-promise';
new Promise((resolve, reject) => {
reject();
}).finally(() => {
// ...
});
Promise.race([
// ...
]).then(() => {
// ...
});
Promise.allSettled([
// ...
]).then(() => {
// ...
});
Promise.any([
// ...
]).then(() => {
// ...
});