noflo-promise

Promises/A+ handling in NoFlo

Promises/A+ for NoFlo

Provide Promises/A+ handling in NoFlo by wrapping around the NPM module promise. It doesn't make sense to create promises in NoFlo because NoFlo itself is the framework to manage your program's flow. Therefore, this package simply provides ways to manipulate existing promises used in parts of your program that are not within NoFlo.

npm install --save noflo-promise

Listed in-ports in bold are required and out-ports in bold always produce IPs.

Wrapper around Promise#from(1) to convert a non-promise into a promise.

  • IN: The value to convert
  • OUT: A promise

Accept a promise, set it to forward the passed value to SUCCESS upon fulfillment of the promise or to FAILURE upon rejection, then forward the promise onto OUT if it's attached.

Each passed parameter is forwarded as an IP. For instance, a promise that would look in procedural JS:

promise.then(function(a, b, c) {

... would be translated as three IPs of the values of a, b, and c.

  • IN: A promise
  • OUT: A promise
  • SUCCESS: Forwarded the passed value on fulfillment
  • FAILURE: Forwarded the passed value on rejection