{"action":"created","issue":{"url":"https://api.github.com/repos/keystonejs/grappling-hook/issues/12","labels_url":"https://api.github.com/repos/keystonejs/grappling-hook/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/keystonejs/grappling-hook/issues/12/comments","events_url":"https://api.github.com/repos/keystonejs/grappling-hook/issues/12/events","html_url":"https://github.com/keystonejs/grappling-hook/issues/12","id":88379853,"number":12,"title":"What with results of wrapped methods?","user":{"login":"creynders","id":436347,"avatar_url":"https://avatars.githubusercontent.com/u/436347?v=3","gravatar_id":"","url":"https://api.github.com/users/creynders","html_url":"https://github.com/creynders","followers_url":"https://api.github.com/users/creynders/followers","following_url":"https://api.github.com/users/creynders/following{/other_user}","gists_url":"https://api.github.com/users/creynders/gists{/gist_id}","starred_url":"https://api.github.com/users/creynders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creynders/subscriptions","organizations_url":"https://api.github.com/users/creynders/orgs","repos_url":"https://api.github.com/users/creynders/repos","events_url":"https://api.github.com/users/creynders/events{/privacy}","received_events_url":"https://api.github.com/users/creynders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-06-15T10:11:40Z","updated_at":"2015-11-24T16:23:53Z","closed_at":null,"body":"ATM all middleware gets the original arguments passed as parameters and are executed in the scope of the emitting instance, e.g.\r\n\r\n```js\r\ninstance.whatever = 'mofo!';\r\ninstance.pre('save', function(a,b){\r\n  console.log(a); //outputs 'foo'\r\n  console.log(b); //outputs 'bar'\r\n  console.log(this.whatever); //outputs 'mofo!'\r\n});\r\ninstance.save('foo', 'bar', _.noop);\r\n```\r\n\r\nHowever, no doubt there's situations where we want to pass some kind of result to `post` middleware.\r\nQuestion is: how? \r\nWould it make more sense to _not_ pass the original arguments to `post` middleware, but the results instead?\r\nOr should we pass it as the first parameter and shift the others? E.g.\r\n\r\n```js\r\ninstance.post('save', function(result, a,b){\r\n  console.log(result); // outputs the results of the `save` operation\r\n  console.log(a); //outputs 'foo'\r\n  console.log(b); //outputs 'bar'\r\n});\r\ninstance.save('foo', 'bar', _.noop);\r\n```\r\n\r\n@JedWatson ?"},"comment":{"url":"https://api.github.com/repos/keystonejs/grappling-hook/issues/comments/159321465","html_url":"https://github.com/keystonejs/grappling-hook/issues/12#issuecomment-159321465","issue_url":"https://api.github.com/repos/keystonejs/grappling-hook/issues/12","id":159321465,"user":{"login":"creynders","id":436347,"avatar_url":"https://avatars.githubusercontent.com/u/436347?v=3","gravatar_id":"","url":"https://api.github.com/users/creynders","html_url":"https://github.com/creynders","followers_url":"https://api.github.com/users/creynders/followers","following_url":"https://api.github.com/users/creynders/following{/other_user}","gists_url":"https://api.github.com/users/creynders/gists{/gist_id}","starred_url":"https://api.github.com/users/creynders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creynders/subscriptions","organizations_url":"https://api.github.com/users/creynders/orgs","repos_url":"https://api.github.com/users/creynders/repos","events_url":"https://api.github.com/users/creynders/events{/privacy}","received_events_url":"https://api.github.com/users/creynders/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T16:23:53Z","updated_at":"2015-11-24T16:23:53Z","body":"@mattapperson yeah, on slack I assumed you meant to allow middleware to manipulate which parameters are being passed through, which discussion _would_ belong here. Sorry for the confusion/sidetrack."}}