0.8.0 • Published 7 years ago

impossible-promise v0.8.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

(IM)POSSIBLE PROMISE

wrapper used to chain native Promises in an async sequence


impossible-promise on NPM Codacy Badge Build Status

Instal from NPM

requires node -v >4.3.2 (for Promises support)

$ npm install impossible-promise

Usage:

use new sequence() and .then() to chain promises use .done() to fetch all results

var sequence = require("impossible-promise")

new sequence((next,reject) => {
    next("giving");
}).then((next,reject) => {
    setTimeout(() => next("is") , 1000);
}).then((next,reject) => {
    next("caring!");
}).done((a,b,c) => {
    console.log([a,b,c].join(" "));
    // => giving is caring!
});

Documentation

check test.js for examples

TODO:

  • propper documentation
  • backwards compatibility
  • browser compatibility
  • support for Promise.race()
  • support for Promise.all()
  • added .promisify()
  • added .pipe()
  • allows new ImpossibePromise() without arguments
  • allows .then(new ImpossibePromise())
  • allows multiple .done()
  • write a CONTRIBUTING.file

LICENSE

MIT, see LICENSE for details.

0.8.0

7 years ago

0.7.1

8 years ago

0.6.0

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago