Skip to content

Lightweight ES6 Promise polyfill for the browser and node. A+ Compliant

License

Notifications You must be signed in to change notification settings

cyxou/imacros-promise-polyfill

 
 

Repository files navigation

This is a port of Taylor's Hakes promise-polyfill for use with iMacros and Browserify.

Node

npm install imacros-promise-polyfill

Simple usage

var Promise = require('imacros-promise-polyfill');

var promise = new Promise(function(resolve, reject) {
  // do a thing, possibly async, then…

  if (/* everything turned out fine */) {
    resolve("Stuff worked!");
  }  else {
    reject(new Error("It broke"));
  }
});

// Do something when async done
promise.then(function() {
  ...
});

License

MIT

About

Lightweight ES6 Promise polyfill for the browser and node. A+ Compliant

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%