Created
April 27, 2012 15:00
-
-
Save msuarz/2509957 to your computer and use it in GitHub Desktop.
async vs step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async.series [ | |
(done) -> fs.writeFile '/tmp/test', 'yay', -> | |
console.log 'yay!!' | |
done null | |
(done) -> | |
console.log 'hello' | |
done null | |
-> console.log 'world' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
step( | |
-> fs.writeFile '/tmp/test', 'yay', @ | |
-> | |
console.log 'yay!!' | |
@ | |
-> | |
console.log 'hello' | |
@ | |
-> console.log 'world' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
writeFile = (done) -> fs.writeFile '/tmp/test', 'yay', ->
console.log 'yay!!'
done null
logMessage = (done) ->
console.log 'hello'
done null
anotherMessage = -> console.log 'world'
async.series [writeFile, logMessage, anotherMessage]