Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

impossible-promise

iampossible40MIT0.8.0

wrapper used to chain native Promises in an async sequence

readme

(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:

  • <input disabled="" type="checkbox"> propper documentation
  • <input checked="" disabled="" type="checkbox"> backwards compatibility
  • <input disabled="" type="checkbox"> browser compatibility
  • <input disabled="" type="checkbox"> support for Promise.race()
  • <input checked="" disabled="" type="checkbox"> support for Promise.all()
  • <input checked="" disabled="" type="checkbox"> added .promisify()
  • <input checked="" disabled="" type="checkbox"> added .pipe()
  • <input checked="" disabled="" type="checkbox"> allows new ImpossibePromise() without arguments
  • <input checked="" disabled="" type="checkbox"> allows .then(new ImpossibePromise())
  • <input checked="" disabled="" type="checkbox"> allows multiple .done()
  • <input disabled="" type="checkbox"> write a CONTRIBUTING.file

LICENSE

MIT, see LICENSE for details.