Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I am using chaining for such code. I have tried to make async.map but it's now real mesh for me. How can I make this code more robust and right?

getValues = (callback) ->
  client.get 'day:today', (err, reply) ->
    return callback err if err
    results = []
    results.push reply.toString()

    client.get 'day:ystd', (err, reply) ->
      return callback err if err
      results.push reply.toString()

      callback null, results
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.