Skip to content

Instantly share code, notes, and snippets.

var step = 0;
async.waterfall([
function (next){
step = 1;
getJson('/user', function(user) { next(null, user); });
},
function (user, next){
step = 2;
getJson('/twitter_profile', user.twitterId, function(twitterProfile) { next(null, user, twitterProfile); });
var step = 0;
async.series([
function (next){
step = 1;
getJson('/country', function(data) { next(null, data); });
},
function (country, next){
step = 2;
getJson('/weather', function(data) { next(null, data); });