UNPKG

seq

Version:

Chainable asynchronous flow control with sequential and parallel primitives and pipeline-style error handling

19 lines (18 loc) 443 B
var Seq = require('seq'); Seq() .par(function () { var that = this; setTimeout(function () { that(null, 'a') }, 300); }) .par(function () { var that = this; setTimeout(function () { that(null, 'b') }, 200); }) .par(function () { var that = this; setTimeout(function () { that(null, 'c') }, 100); }) .seq(function (a, b, c) { console.dir([ a, b, c ]) }) ;