Skip to content

FSPromise.js, Part of FantaSite Framework. Add abort method for ES6 Promise (currently use polyfill ES6Promise).

License

Notifications You must be signed in to change notification settings

JamendoMusic/FSPromise

 
 

Repository files navigation

FSPromise 0.2.2

==============

This project could be used in production. I wrote this for another project I'm working on right now. Testing, fixes and comments are welcome.

FSPromise project details

  • Extend ES6Promise until full implementation of Promise in all browser.
  • Use native Promise support
  • If you want to use ES6Promise polyfill, you have to do this directly to your application.

It offers the same methods and usage as native Promise, but add a method abort() to stop all Promise chain execution.

It's an UMD module, so you can include it in your CommonJS/AMD project.

Exemple of usage:

import FSPromise = require('fspromise');
import Promise = FSPromise.FSPromise; // Create an alias

FSPromise.Async = true; // Force async mode for Promise resolver.

let promise = new Promise((resolve, reject) => {
	// do something
});

promise.catch((error) => {
	console.log(error); //FSPromiseCancelError
});

promise.abort();

About

FSPromise.js, Part of FantaSite Framework. Add abort method for ES6 Promise (currently use polyfill ES6Promise).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 54.4%
  • TypeScript 45.6%