{"action":"created","issue":{"url":"https://api.github.com/repos/toranb/ember-redux/issues/17","repository_url":"https://api.github.com/repos/toranb/ember-redux","labels_url":"https://api.github.com/repos/toranb/ember-redux/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/toranb/ember-redux/issues/17/comments","events_url":"https://api.github.com/repos/toranb/ember-redux/issues/17/events","html_url":"https://github.com/toranb/ember-redux/issues/17","id":172032693,"number":17,"title":"Consider exploding args in the route.js function","user":{"login":"foxnewsnetwork","id":1010423,"avatar_url":"https://avatars.githubusercontent.com/u/1010423?v=3","gravatar_id":"","url":"https://api.github.com/users/foxnewsnetwork","html_url":"https://github.com/foxnewsnetwork","followers_url":"https://api.github.com/users/foxnewsnetwork/followers","following_url":"https://api.github.com/users/foxnewsnetwork/following{/other_user}","gists_url":"https://api.github.com/users/foxnewsnetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/foxnewsnetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foxnewsnetwork/subscriptions","organizations_url":"https://api.github.com/users/foxnewsnetwork/orgs","repos_url":"https://api.github.com/users/foxnewsnetwork/repos","events_url":"https://api.github.com/users/foxnewsnetwork/events{/privacy}","received_events_url":"https://api.github.com/users/foxnewsnetwork/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-19T00:48:37Z","updated_at":"2016-08-20T01:21:30Z","closed_at":"2016-08-20T01:21:30Z","body":"Background\r\n===\r\nIn your code at https://github.com/toranb/ember-redux/blob/master/addon/route.js#L12 we see:\r\n\r\n```javascript\r\nroute[func] = function(args) {\r\n  return funcs[func](redux.dispatch.bind(redux), args);\r\n};\r\n```\r\n\r\nNotably, the `args` param only captures the first parameter of whatever native `Ember.Route` method we're declaring. Consider making the following changes:\r\n\r\nSuggested Changes\r\n===\r\n```javascript\r\nroute[func] = function(...args) {\r\n  args.unshift(redux.dispatch.bind(redux));\r\n  return funcs[func].apply(route, args);\r\n};\r\n```\r\n\r\nReasoning\r\n===\r\n`Ember.Route` methods such as `beforeModel`, `afterModel`, etc., all get passed not only the model, but also the transition, and other such possible parameters. Properly passing those parameters in may be useful for users.\r\n\r\nQuestions\r\n===\r\nQ: What do you think? If you're okay with it, I'll can do a PR when I get off of work\r\n\r\nQ: Why not also pass in `redux.subscribe`? Is using `subscribe` in the route not recommend?\r\n\r\nNotes\r\n===\r\nThanks for your guidance in the slack chat the other day, I looked into redux-saga and it seems more and more that's the way we'll wind up going with.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/toranb/ember-redux/issues/comments/241169531","html_url":"https://github.com/toranb/ember-redux/issues/17#issuecomment-241169531","issue_url":"https://api.github.com/repos/toranb/ember-redux/issues/17","id":241169531,"user":{"login":"toranb","id":147411,"avatar_url":"https://avatars.githubusercontent.com/u/147411?v=3","gravatar_id":"","url":"https://api.github.com/users/toranb","html_url":"https://github.com/toranb","followers_url":"https://api.github.com/users/toranb/followers","following_url":"https://api.github.com/users/toranb/following{/other_user}","gists_url":"https://api.github.com/users/toranb/gists{/gist_id}","starred_url":"https://api.github.com/users/toranb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toranb/subscriptions","organizations_url":"https://api.github.com/users/toranb/orgs","repos_url":"https://api.github.com/users/toranb/repos","events_url":"https://api.github.com/users/toranb/events{/privacy}","received_events_url":"https://api.github.com/users/toranb/received_events","type":"User","site_admin":false},"created_at":"2016-08-20T01:21:30Z","updated_at":"2016-08-20T01:21:30Z","body":"Thanks again - your PR getting merged now closes this out :)"}}
{"actor":{"display_login":"toranb"}}