Skip to content

Instantly share code, notes, and snippets.

@billyvg
Created July 22, 2012 22:42
Show Gist options
  • Save billyvg/3161268 to your computer and use it in GitHub Desktop.
Save billyvg/3161268 to your computer and use it in GitHub Desktop.
list: (socket, msg, fn) ->
results = []
expectedCount = 0
addResult = (result) ->
results.push result
fn results if results.length is expectedCount
r.lrange 'boards', 0, -1, (err, items) ->
expectedCount = items.length
_.each items, (item) ->
r.hgetall "board:#{ item }", (err, details) ->
addResult details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment