Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    getPosts (ids, cb) ->
        res = []
        stash = (err, post) ->
          res.push post
          cb(res) if res.length is ids.length
        db.getPostById(id, stash) for id in ids
        
    getPosts [...], (posts) ->
        # go on...
use `res[i] = post` if there is some implicit ordering.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: