{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/redux/issues/177","labels_url":"https://api.github.com/repos/gaearon/redux/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/redux/issues/177/comments","events_url":"https://api.github.com/repos/gaearon/redux/issues/177/events","html_url":"https://github.com/gaearon/redux/issues/177","id":90691322,"number":177,"title":"React router integration","user":{"login":"malte-wessel","id":1020216,"avatar_url":"https://avatars.githubusercontent.com/u/1020216?v=3","gravatar_id":"","url":"https://api.github.com/users/malte-wessel","html_url":"https://github.com/malte-wessel","followers_url":"https://api.github.com/users/malte-wessel/followers","following_url":"https://api.github.com/users/malte-wessel/following{/other_user}","gists_url":"https://api.github.com/users/malte-wessel/gists{/gist_id}","starred_url":"https://api.github.com/users/malte-wessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malte-wessel/subscriptions","organizations_url":"https://api.github.com/users/malte-wessel/orgs","repos_url":"https://api.github.com/users/malte-wessel/repos","events_url":"https://api.github.com/users/malte-wessel/events{/privacy}","received_events_url":"https://api.github.com/users/malte-wessel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-06-24T14:25:45Z","updated_at":"2015-06-25T20:44:42Z","closed_at":null,"body":"I'm not sure if this was already considered. I'm currently playing around with a react-router integration and want my actions to return a transition statement:\r\n\r\n```javascript\r\nexport function loginSuccess(user) {\r\n  return {\r\n    user: user,\r\n    type: LOGIN_SUCCESS,\r\n    transitionTo: '/dashboard'\r\n  };\r\n}\r\n```\r\n\r\nIn my case it's necessary to run the transition after the dispatch is finished. My idea was to compose the middleware stack like this:\r\n\r\n```javascript\r\nconst dispatcher = createDispatcher(\r\n    composeStores(reducers),\r\n    (getState, dispatch) => [ thunk(getState), logger, dispatch, transition ]\r\n);\r\n````\r\n\r\nThe transition middleware should read the `transitionTo` key and invoke the routers transition method.\r\nAny idea how this could be done?"},"comment":{"url":"https://api.github.com/repos/gaearon/redux/issues/comments/115391658","html_url":"https://github.com/gaearon/redux/issues/177#issuecomment-115391658","issue_url":"https://api.github.com/repos/gaearon/redux/issues/177","id":115391658,"user":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars.githubusercontent.com/u/3624098?v=3","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T20:44:42Z","updated_at":"2015-06-25T20:44:42Z","body":"I like this reactive approach better because now it doesn't matter *how* the user logs in as long as the state field has changed. You can use a login form, a web socket event, whatever... no need for separate `transitionTo()` calls.\r\n\r\nClearly not *all* transitions should be done this way (not even most), but I think it's best for transitions that are side effects of Flux actions."}}