Hacker Newsnew | comments | show | ask | jobs | submit login

    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 | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: