Closed jayjanssen closed 8 years ago
I know I'm missing something really dumb here:
request = require 'request' test_function = () -> console.log "Step 2" await request 'http://www.google.com', defer(error, response, data) console.log "Step 3" console.log "Step 1" test_function() console.log "Step 4"
My output is:
1 2 4 3
I'm obviously (I think) expecting numerical order. What am I doing wrong?
test_function itself needs to take a cb and you need to await / defer on it.
test_function
cb
await
defer
I know I'm missing something really dumb here:
My output is:
I'm obviously (I think) expecting numerical order. What am I doing wrong?