{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/redux-simple-router/issues/205","labels_url":"https://api.github.com/repos/rackt/redux-simple-router/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/rackt/redux-simple-router/issues/205/comments","events_url":"https://api.github.com/repos/rackt/redux-simple-router/issues/205/events","html_url":"https://github.com/rackt/redux-simple-router/issues/205","id":127080973,"number":205,"title":"Add route data to reducer action","user":{"login":"jisaacks","id":1355481,"avatar_url":"https://avatars.githubusercontent.com/u/1355481?v=3","gravatar_id":"","url":"https://api.github.com/users/jisaacks","html_url":"https://github.com/jisaacks","followers_url":"https://api.github.com/users/jisaacks/followers","following_url":"https://api.github.com/users/jisaacks/following{/other_user}","gists_url":"https://api.github.com/users/jisaacks/gists{/gist_id}","starred_url":"https://api.github.com/users/jisaacks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jisaacks/subscriptions","organizations_url":"https://api.github.com/users/jisaacks/orgs","repos_url":"https://api.github.com/users/jisaacks/repos","events_url":"https://api.github.com/users/jisaacks/events{/privacy}","received_events_url":"https://api.github.com/users/jisaacks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-17T08:09:41Z","updated_at":"2016-01-17T11:27:15Z","closed_at":null,"body":"My route that I am using looks like this:\r\n\r\n```javascript\r\n<Route path=\"/messages/:id\" component={Message} />\r\n```\r\n\r\nIn my `Message` component I have access to `this.props.params.id`.\r\n\r\nIn my reducer my `action` looks like this:\r\n\r\n```javascript\r\nlocation: {\r\n  action: \"POP\"\r\n  hash: \"#/messages/2?_k=xcl5yg\"\r\n  key: \"u1jk2m\"\r\n  pathname: \"/\"\r\n  search: \"\"\r\n  state: null\r\n},\r\ntype: \"@@router/UPDATE_LOCATION\"\r\n```\r\n-----\r\n\r\nSo a couple issues I see here. \r\n\r\nFirst, using this relies on my reducer knowing first hand whether the router is using `hash` or `pushState`. I shouldn't have to change my reducers if I change how my router is configured. \r\n\r\nSecond, there is a params object given to my component via the router but not present in the action.\r\n\r\nTo solve these I think there needs to be an extra `route` object on the action so it looks like so:\r\n\r\n ```javascript\r\nlocation: {\r\n  action: \"POP\"\r\n  hash: \"#/messages/2?_k=xcl5yg\"\r\n  key: \"u1jk2m\"\r\n  pathname: \"/\"\r\n  search: \"\"\r\n  state: null\r\n},\r\nroute: {\r\n  path: \"/messages/2\",\r\n  params: {\r\n    id: 2\r\n  }\r\n},\r\ntype: \"@@router/UPDATE_LOCATION\"\r\n```\r\n\r\n-----\r\n\r\nIf I am just completely off base on this or using this library wrong then please point me in the right direction. Also I would be more than willing to help out with this, I have experience hacking on [routers](https://github.com/emcien/Backbone.RouteHelper)"},"comment":{"url":"https://api.github.com/repos/rackt/redux-simple-router/issues/comments/172315373","html_url":"https://github.com/rackt/redux-simple-router/issues/205#issuecomment-172315373","issue_url":"https://api.github.com/repos/rackt/redux-simple-router/issues/205","id":172315373,"user":{"login":"rockingskier","id":681614,"avatar_url":"https://avatars.githubusercontent.com/u/681614?v=3","gravatar_id":"","url":"https://api.github.com/users/rockingskier","html_url":"https://github.com/rockingskier","followers_url":"https://api.github.com/users/rockingskier/followers","following_url":"https://api.github.com/users/rockingskier/following{/other_user}","gists_url":"https://api.github.com/users/rockingskier/gists{/gist_id}","starred_url":"https://api.github.com/users/rockingskier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockingskier/subscriptions","organizations_url":"https://api.github.com/users/rockingskier/orgs","repos_url":"https://api.github.com/users/rockingskier/repos","events_url":"https://api.github.com/users/rockingskier/events{/privacy}","received_events_url":"https://api.github.com/users/rockingskier/received_events","type":"User","site_admin":false},"created_at":"2016-01-17T11:27:15Z","updated_at":"2016-01-17T11:27:15Z","body":"This sounds sensible.  I was just looking for how to access the url params but cant see where to get them from.  When hitting my app I need to get a route param to work out what data to start fetching."}}