{"action":"opened","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/1017","labels_url":"https://api.github.com/repos/rackt/react-router/issues/1017/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/1017/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/1017/events","html_url":"https://github.com/rackt/react-router/issues/1017","id":64507698,"number":1017,"title":"Allow data to be stored on routes and available within state. ","user":{"login":"ryardley","id":1256409,"avatar_url":"https://avatars.githubusercontent.com/u/1256409?v=3","gravatar_id":"","url":"https://api.github.com/users/ryardley","html_url":"https://github.com/ryardley","followers_url":"https://api.github.com/users/ryardley/followers","following_url":"https://api.github.com/users/ryardley/following{/other_user}","gists_url":"https://api.github.com/users/ryardley/gists{/gist_id}","starred_url":"https://api.github.com/users/ryardley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryardley/subscriptions","organizations_url":"https://api.github.com/users/ryardley/orgs","repos_url":"https://api.github.com/users/ryardley/repos","events_url":"https://api.github.com/users/ryardley/events{/privacy}","received_events_url":"https://api.github.com/users/ryardley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-26T11:50:21Z","updated_at":"2015-03-26T11:50:21Z","closed_at":null,"body":"It would be advantageous to attach data to the routes that could be available in route changed callbacks. A concrete usecase would be attaching action references to a specific route whilst using flux.\r\n\r\n```bash\r\n\r\nvar doSomethingEverytime = require('actions/doSomethingEverytime');\r\nvar fetchAboutData = require('actions/fetchAboutData');\r\nvar fetchHomeData = require('actions/fetchHomeData');\r\n\r\nexport default (\r\n  <Route name=\"app\" path=\"/\" handler={Application} data={doSomethingEverytime} />\r\n    <Route name=\"about\" handler={About}  data={fetchAboutData} />\r\n    <DefaultRoute name=\"home\" handler={Home} data={fetchHomeData} />\r\n  </Route>\r\n)\r\n```\r\n\r\nIt would then be useful to get the data as an array in the callback after a route has changed:\r\n\r\n```bash\r\n// example if data happened to be references to action functions.\r\nRouter.run(component, HistoryLocation, (Handler, state) => {\r\n  state.data.forEach(function(actionReference){\r\n    context.executeAction(actionReference);\r\n  });\r\n});\r\n```\r\n"}}