19 ms·
Why not something like this? function routine () { doIOForMe(function (resp) { doMoreIO(resp, function (nextResp) { transform(nextR
by IsaacSchlueter 16y ago
Why not something like this?
function routine () {
doIOForMe(function (resp) {
doMoreIO(resp, function (nextResp) {
transform(nextResp)
})
})
}
// or with a little helper function:
function routine () {
chainTogether
( doIOForMe
, doMoreIO
, transform
)
}
The "Step" library from Tim Caswell (creationix) lets you do a LOT of very interesting parallel/serial stuff. In npm, I have a few helper functions that make it easy to do serial "this then that" stuff.
It would be nice to have something in the language that does this. Maybe something for the Coffeescript guys to check out. For me, plain old JavaScript is enough, I guess.