{"action":"created","issue":{"url":"https://api.github.com/repos/caolan/highland/issues/221","labels_url":"https://api.github.com/repos/caolan/highland/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/caolan/highland/issues/221/comments","events_url":"https://api.github.com/repos/caolan/highland/issues/221/events","html_url":"https://github.com/caolan/highland/pull/221","id":56352080,"number":221,"title":"new invokeCallback method","user":{"login":"maxgurewitz","id":1750599,"avatar_url":"https://avatars.githubusercontent.com/u/1750599?v=3","gravatar_id":"","url":"https://api.github.com/users/maxgurewitz","html_url":"https://github.com/maxgurewitz","followers_url":"https://api.github.com/users/maxgurewitz/followers","following_url":"https://api.github.com/users/maxgurewitz/following{/other_user}","gists_url":"https://api.github.com/users/maxgurewitz/gists{/gist_id}","starred_url":"https://api.github.com/users/maxgurewitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxgurewitz/subscriptions","organizations_url":"https://api.github.com/users/maxgurewitz/orgs","repos_url":"https://api.github.com/users/maxgurewitz/repos","events_url":"https://api.github.com/users/maxgurewitz/events{/privacy}","received_events_url":"https://api.github.com/users/maxgurewitz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-03T09:18:00Z","updated_at":"2015-02-04T02:44:24Z","closed_at":"2015-02-03T17:32:45Z","pull_request":{"url":"https://api.github.com/repos/caolan/highland/pulls/221","html_url":"https://github.com/caolan/highland/pull/221","diff_url":"https://github.com/caolan/highland/pull/221.diff","patch_url":"https://github.com/caolan/highland/pull/221.patch"},"body":"Includes new invokeCallback method and associated test.\r\n\r\nThis pull request is motivated by my personal difficulty in using highland with mongoose, the mongoDB odm.  Common mongoose async operations like Model.findOne({ _id: 'abc123' }, cb) are context dependent, and don't work with _.wrapCallback.\r\n\r\nI've been extending highland with this method in my personal projects, but it's possible that I'm missing a simpler solution using highland's existing library."},"comment":{"url":"https://api.github.com/repos/caolan/highland/issues/comments/72780504","html_url":"https://github.com/caolan/highland/pull/221#issuecomment-72780504","issue_url":"https://api.github.com/repos/caolan/highland/issues/221","id":72780504,"user":{"login":"maxgurewitz","id":1750599,"avatar_url":"https://avatars.githubusercontent.com/u/1750599?v=3","gravatar_id":"","url":"https://api.github.com/users/maxgurewitz","html_url":"https://github.com/maxgurewitz","followers_url":"https://api.github.com/users/maxgurewitz/followers","following_url":"https://api.github.com/users/maxgurewitz/following{/other_user}","gists_url":"https://api.github.com/users/maxgurewitz/gists{/gist_id}","starred_url":"https://api.github.com/users/maxgurewitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxgurewitz/subscriptions","organizations_url":"https://api.github.com/users/maxgurewitz/orgs","repos_url":"https://api.github.com/users/maxgurewitz/repos","events_url":"https://api.github.com/users/maxgurewitz/events{/privacy}","received_events_url":"https://api.github.com/users/maxgurewitz/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T02:44:24Z","updated_at":"2015-02-04T02:44:24Z","body":"@LewisJEllis yes _.wrapCallback(context.method.bind(context)) works, but it is very verbose.  I don't think its great to force users to write e.g. _.wrapCallback(Product.FindOne.bind(Product)) (I ran into this problem while using mongoose).  I can add an error test case."}}