{"action":"opened","issue":{"url":"https://api.github.com/repos/caolan/highland/issues/296","labels_url":"https://api.github.com/repos/caolan/highland/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/caolan/highland/issues/296/comments","events_url":"https://api.github.com/repos/caolan/highland/issues/296/events","html_url":"https://github.com/caolan/highland/issues/296","id":73685751,"number":296,"title":"wrapCallback is uncurryable","user":{"login":"brian-gates","id":97096,"avatar_url":"https://avatars.githubusercontent.com/u/97096?v=3","gravatar_id":"","url":"https://api.github.com/users/brian-gates","html_url":"https://github.com/brian-gates","followers_url":"https://api.github.com/users/brian-gates/followers","following_url":"https://api.github.com/users/brian-gates/following{/other_user}","gists_url":"https://api.github.com/users/brian-gates/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-gates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-gates/subscriptions","organizations_url":"https://api.github.com/users/brian-gates/orgs","repos_url":"https://api.github.com/users/brian-gates/repos","events_url":"https://api.github.com/users/brian-gates/events{/privacy}","received_events_url":"https://api.github.com/users/brian-gates/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-06T17:33:05Z","updated_at":"2015-05-06T17:33:05Z","closed_at":null,"body":"    var foo = _.wrapCallback(function (thing, done){\r\n      done(null, thing);\r\n    });\r\n\r\n    foo('bar').apply(_.log); // bar\r\n\r\n    _.curry(foo)('bar').apply(_.log);\r\n    //          ^\r\n    // TypeError: object is not a function\r\n\r\nThe issue is that wrapCallback handles its arguments dynamically.  I'm not sure there's any way around it, but I wanted to raise it for discussion as it would be a useful thing to be able to do.  I suppose _.partial could be used instead, but that's less elegant.\r\n\r\n    // _.wrapCallback\r\n    function () {\r\n        var self = this;\r\n        var args = slice.call(arguments);\r\n        return _(function (push) {\r\n            var cb = function (err, x) {\r\n                if (err) {\r\n                    push(err);\r\n                }\r\n                else {\r\n                    push(null, x);\r\n                }\r\n                push(null, nil);\r\n            };\r\n            f.apply(self, args.concat([cb]));\r\n        });\r\n    }\r\n"}}