All Projects → lahmatiy → Es6 Promise Polyfill

lahmatiy / Es6 Promise Polyfill

Licence: mit
ES6 Promise polyfill

Programming Languages

javascript
184084 projects - #8 most used programming language
es6
455 projects
es2015
71 projects

Projects that are alternatives of or similar to Es6 Promise Polyfill

Core Js
Standard Library
Stars: ✭ 15,854 (+15914.14%)
Mutual labels:  promise, polyfill
Ts Polyfill
Runtime polyfills for TypeScript libs, powered by core-js! 🔋 🔩
Stars: ✭ 122 (+23.23%)
Mutual labels:  promise, polyfill
Tickedoff
Tiny library (<200B gzip) for deferring something by a "tick"
Stars: ✭ 213 (+115.15%)
Mutual labels:  promise, polyfill
Promise.allSettled
ES Proposal spec-compliant shim for Promise.allSettled
Stars: ✭ 93 (-6.06%)
Mutual labels:  polyfill, promise
parcel-plugin-goodie-bag
provides the Promise and fetch goodies needed for IE(11) support w/ parcel bundle loading
Stars: ✭ 15 (-84.85%)
Mutual labels:  polyfill, promise
Promise Fun
Promise packages, patterns, chat, and tutorials
Stars: ✭ 3,779 (+3717.17%)
Mutual labels:  promise, polyfill
webpack2-polyfill-plugin
Insert polyfills (such as Promise) for Webpack 2
Stars: ✭ 18 (-81.82%)
Mutual labels:  polyfill, promise
Fetch
A window.fetch JavaScript polyfill.
Stars: ✭ 25,118 (+25271.72%)
Mutual labels:  promise, polyfill
Vine
Python promises
Stars: ✭ 83 (-16.16%)
Mutual labels:  promise
Polyfill Php54
This component provides functions unavailable in releases prior to PHP 5.4.
Stars: ✭ 93 (-6.06%)
Mutual labels:  polyfill
Vue Rawmodel
RawModel.js plugin for Vue.js v2. Form validation has never been easier!
Stars: ✭ 79 (-20.2%)
Mutual labels:  promise
Angular2 Promise Buttons
Chilled loading buttons for angular2
Stars: ✭ 84 (-15.15%)
Mutual labels:  promise
Date Time Format Timezone
Surgically polyfills timezone support in Intl.DateTimeFormat API
Stars: ✭ 94 (-5.05%)
Mutual labels:  polyfill
Node Promisepipe
Safely pipe node.js streams while capturing all errors to a single promise
Stars: ✭ 79 (-20.2%)
Mutual labels:  promise
Polyfill
PHP polyfills
Stars: ✭ 1,333 (+1246.46%)
Mutual labels:  polyfill
Sake Core
Sake's core interface.
Stars: ✭ 78 (-21.21%)
Mutual labels:  promise
Webworker Promise
Promise based wrapper for webworkers
Stars: ✭ 77 (-22.22%)
Mutual labels:  promise
Polyfill
Polyfill implements newer Ruby features into older versions.
Stars: ✭ 98 (-1.01%)
Mutual labels:  polyfill
Proposal Array Unique
ECMAScript proposal for Deduplicating method of Array
Stars: ✭ 96 (-3.03%)
Mutual labels:  polyfill
Mfetch
mfetch will provide you with a strong ability to request resource management
Stars: ✭ 90 (-9.09%)
Mutual labels:  promise

NPM version Build Status

ES6 Promise polyfill

This is a polyfill of ES6 Promise. The implementation based on Jake Archibald implementation a subset of rsvp.js. If you're wanting extra features and more debugging options, check out the full library.

For API details and how to use promises, see the JavaScript Promises HTML5Rocks article.

Notes

The main target: implementation should be conformance with browser's implementations and to be minimal as possible in size. So it's strictly polyfill of ES6 Promise specification and nothing more.

It passes both Promises/A+ test suite and rsvp.js test suite. And as small as 2,6KB min (or 1KB min+gzip).

The polyfill uses setImmediate if available, or fallback to use setTimeout. Use setImmediate polyfill by @YuzuJS to reach better performance.

How to use

Browser

To install:

bower install es6-promise-polyfill

To use:

<script src="bower_components/es6-promise-polyfill/promise.min.js"></script>
<script>
  var promise = new Promise(...);
</script>

Node.js

To install:

npm install es6-promise-polyfill

To use:

var Promise = require('es6-promise-polyfill').Promise;
var promise = new Promise(...);

AMD

To install:

npm install es6-promise-polyfill

To use:

define(['es6-promise-polyfill'], function(Promise) {
  var promise = new Promise(...);
});

Usage in IE<9

catch is a reserved word in IE<9, meaning promise.catch(func) throws a syntax error. To work around this, use a string to access the property:

promise['catch'](function(err) {
  // ...
});

Or use .then instead:

promise.then(undefined, function(err) {
  // ...
});

License

Licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].