Skip to content
Eugene Lazutkin edited this page Mar 16, 2016 · 5 revisions

This module provides functionality by instrumenting async.generic.seq with Promise. It returns either a function, or null, if Promise is not available on user's platform.

Simple example with synchronous functions:

var seq = require('heya-async/seq');

var chain = seq([
  function (value) { return value + 1; },
  function (value) { return 2 * value; },
  function (value) { return value / 10; }
]);

chain.end.then(
  function (value) { console.log('Should be 5:', value); return value; });
chain.resolve(24); // start the chain