JSPM

  • Created
  • Published
  • Downloads 3682455
  • Score
    100M100P100Q260677F
  • License MIT

Light weight promise polyfill. A+ compliant

Package Exports

  • promise-polyfill

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (promise-polyfill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Promise

Light weight promise polyfill for the browser and node. A+ Compliant. It is a perfect polyfill IE, Firefox or any other browser that does not support native promises.

This implementation is based on then/promise. It has been changed to use the prototype for performance and memory reasons.

For API information about Promises, please check out this article HTML5Rocks article.

It is extremely light weight. < 1kb Gzipped

Downloads

Simple use

var prom = new Promise(function(resolve, reject) {
  setTimeout(resolve, 1000);
});

// Do something after 1000 milliseconds
prom.then(function() {
  ...
});

Testing

npm install
npm test

License

MIT