9 ms·
I wish this was rated higher. I don't understand the fuss about "spaghetti code". Do all those people write spaghetti code in other languages? Because I see tha
by randylahey 16y ago
I wish this was rated higher. I don't understand the fuss about "spaghetti code". Do all those people write spaghetti code in other languages? Because I see that not as a language failing but as sloppy programming.
What's so hard about this to get a sequential execution of functions/blocks, error'ing out on the first error:
async.waterfall(
[ function (callback) {
// do thing 1
callback();
}
, function (callback) {
// do thing 2
callback();
}
, function (callback) {
// do thing 3
callback();
}
]
, function (error) {
if (error) {
// ohnoes errors
}
// all done!
}
);