{"action":"created","comment":{"url":"https://api.github.com/repos/shri-2015-org/666/pulls/comments/41138285","id":41138285,"diff_hunk":"@@ -28,30 +28,27 @@ export const joinRoom = roomID => (dispatch, getState) => {\n     };\n   }\n   dispatch(actions.joinRoom(roomID));\n-  transport.joinRoom(partial)\n-    .then(data => {\n-      dispatch(actions.confirmJoinRoom(data));\n-      // TODO think about split switch fron join\n-      dispatch(actions.switchToJoinedRoom(data.room.roomID));\n-    }, description =>\n-      dispatch(actions.rejectJoinRoom(description))\n-    );\n+  const result = transport.joinRoom(partial)\n+    .then(data => actions.confirmJoinRoom(data),\n+          description => actions.rejectJoinRoom(description));\n+  return dispatch(result);\n };\n \n export const reJoinRooms = rooms => dispatch => {\n   if (!rooms) return; // void\n   const roomKeys = Object.keys(rooms);\n-  roomKeys.map(roomID => { dispatch(joinRoom(roomID)); });\n+  roomKeys.map(roomID => dispatch(joinRoom(roomID)));\n };\n \n export const switchToRoom = roomID => (dispatch, getState) => {\n   const state = getState();\n   const { currentRoomID } = state.ui;\n-  if (currentRoomID === roomID) return; // do nothing!\n+  if (roomID && currentRoomID === roomID) return; // do nothing!\n   const needToJoin = state.joinedRooms[roomID] === undefined;\n \n   if (needToJoin) {\n-    dispatch(joinRoom(roomID));\n+    dispatch(joinRoom(roomID))","path":"client/smartActions.js","position":34,"original_position":34,"commit_id":"c8b0494e4fc4bdf494a04d340ffee4ef5686b161","original_commit_id":"c8b0494e4fc4bdf494a04d340ffee4ef5686b161","user":{"login":"tempname11","id":8409150,"avatar_url":"https://avatars.githubusercontent.com/u/8409150?v=3","gravatar_id":"","url":"https://api.github.com/users/tempname11","html_url":"https://github.com/tempname11","followers_url":"https://api.github.com/users/tempname11/followers","following_url":"https://api.github.com/users/tempname11/following{/other_user}","gists_url":"https://api.github.com/users/tempname11/gists{/gist_id}","starred_url":"https://api.github.com/users/tempname11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tempname11/subscriptions","organizations_url":"https://api.github.com/users/tempname11/orgs","repos_url":"https://api.github.com/users/tempname11/repos","events_url":"https://api.github.com/users/tempname11/events{/privacy}","received_events_url":"https://api.github.com/users/tempname11/received_events","type":"User","site_admin":false},"body":"Хм, а можно было и без promise middleware обойтись. Написать `joinRoom(roomID)(dispatch, getState).then(...);","created_at":"2015-10-05T12:37:24Z","updated_at":"2015-10-05T12:37:24Z","html_url":"https://github.com/shri-2015-org/666/pull/125#discussion_r41138285","pull_request_url":"https://api.github.com/repos/shri-2015-org/666/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/shri-2015-org/666/pulls/comments/41138285"},"html":{"href":"https://github.com/shri-2015-org/666/pull/125#discussion_r41138285"},"pull_request":{"href":"https://api.github.com/repos/shri-2015-org/666/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/shri-2015-org/666/pulls/125","id":46729952,"html_url":"https://github.com/shri-2015-org/666/pull/125","diff_url":"https://github.com/shri-2015-org/666/pull/125.diff","patch_url":"https://github.com/shri-2015-org/666/pull/125.patch","issue_url":"https://api.github.com/repos/shri-2015-org/666/issues/125","number":125,"state":"open","locked":false,"title":"Управление асинхронными изменениями стора(dispatch)","user":{"login":"Pofigizm","id":6995947,"avatar_url":"https://avatars.githubusercontent.com/u/6995947?v=3","gravatar_id":"","url":"https://api.github.com/users/Pofigizm","html_url":"https://github.com/Pofigizm","followers_url":"https://api.github.com/users/Pofigizm/followers","following_url":"https://api.github.com/users/Pofigizm/following{/other_user}","gists_url":"https://api.github.com/users/Pofigizm/gists{/gist_id}","starred_url":"https://api.github.com/users/Pofigizm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pofigizm/subscriptions","organizations_url":"https://api.github.com/users/Pofigizm/orgs","repos_url":"https://api.github.com/users/Pofigizm/repos","events_url":"https://api.github.com/users/Pofigizm/events{/privacy}","received_events_url":"https://api.github.com/users/Pofigizm/received_events","type":"User","site_admin":false},"body":"Этот ПР в мою же ветку про восстановление состояния.\r\nТам возникла проблема что когда мы в smartAction делаем joinRoom то по приходу данных обновляется стор и осуществляется переход в эту комнату. При восстановление данных такое поведение не требуется.","created_at":"2015-10-04T18:22:45Z","updated_at":"2015-10-05T12:37:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94c8bc3c269a9de5f27cfad2504eb88e08deaf16","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shri-2015-org/666/pulls/125/commits","review_comments_url":"https://api.github.com/repos/shri-2015-org/666/pulls/125/comments","review_comment_url":"https://api.github.com/repos/shri-2015-org/666/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shri-2015-org/666/issues/125/comments","statuses_url":"https://api.github.com/repos/shri-2015-org/666/statuses/c8b0494e4fc4bdf494a04d340ffee4ef5686b161","head":{"label":"shri-2015-org:pofigizm.chain.dispatch","ref":"pofigizm.chain.dispatch","sha":"c8b0494e4fc4bdf494a04d340ffee4ef5686b161","user":{"login":"shri-2015-org","id":14175246,"avatar_url":"https://avatars.githubusercontent.com/u/14175246?v=3","gravatar_id":"","url":"https://api.github.com/users/shri-2015-org","html_url":"https://github.com/shri-2015-org","followers_url":"https://api.github.com/users/shri-2015-org/followers","following_url":"https://api.github.com/users/shri-2015-org/following{/other_user}","gists_url":"https://api.github.com/users/shri-2015-org/gists{/gist_id}","starred_url":"https://api.github.com/users/shri-2015-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shri-2015-org/subscriptions","organizations_url":"https://api.github.com/users/shri-2015-org/orgs","repos_url":"https://api.github.com/users/shri-2015-org/repos","events_url":"https://api.github.com/users/shri-2015-org/events{/privacy}","received_events_url":"https://api.github.com/users/shri-2015-org/received_events","type":"Organization","site_admin":false},"repo":{"id":42351789,"name":"666","full_name":"shri-2015-org/666","owner":{"login":"shri-2015-org","id":14175246,"avatar_url":"https://avatars.githubusercontent.com/u/14175246?v=3","gravatar_id":"","url":"https://api.github.com/users/shri-2015-org","html_url":"https://github.com/shri-2015-org","followers_url":"https://api.github.com/users/shri-2015-org/followers","following_url":"https://api.github.com/users/shri-2015-org/following{/other_user}","gists_url":"https://api.github.com/users/shri-2015-org/gists{/gist_id}","starred_url":"https://api.github.com/users/shri-2015-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shri-2015-org/subscriptions","organizations_url":"https://api.github.com/users/shri-2015-org/orgs","repos_url":"https://api.github.com/users/shri-2015-org/repos","events_url":"https://api.github.com/users/shri-2015-org/events{/privacy}","received_events_url":"https://api.github.com/users/shri-2015-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shri-2015-org/666","description":"666","fork":false,"url":"https://api.github.com/repos/shri-2015-org/666","forks_url":"https://api.github.com/repos/shri-2015-org/666/forks","keys_url":"https://api.github.com/repos/shri-2015-org/666/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shri-2015-org/666/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shri-2015-org/666/teams","hooks_url":"https://api.github.com/repos/shri-2015-org/666/hooks","issue_events_url":"https://api.github.com/repos/shri-2015-org/666/issues/events{/number}","events_url":"https://api.github.com/repos/shri-2015-org/666/events","assignees_url":"https://api.github.com/repos/shri-2015-org/666/assignees{/user}","branches_url":"https://api.github.com/repos/shri-2015-org/666/branches{/branch}","tags_url":"https://api.github.com/repos/shri-2015-org/666/tags","blobs_url":"https://api.github.com/repos/shri-2015-org/666/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shri-2015-org/666/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shri-2015-org/666/git/refs{/sha}","trees_url":"https://api.github.com/repos/shri-2015-org/666/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shri-2015-org/666/statuses/{sha}","languages_url":"https://api.github.com/repos/shri-2015-org/666/languages","stargazers_url":"https://api.github.com/repos/shri-2015-org/666/stargazers","contributors_url":"https://api.github.com/repos/shri-2015-org/666/contributors","subscribers_url":"https://api.github.com/repos/shri-2015-org/666/subscribers","subscription_url":"https://api.github.com/repos/shri-2015-org/666/subscription","commits_url":"https://api.github.com/repos/shri-2015-org/666/commits{/sha}","git_commits_url":"https://api.github.com/repos/shri-2015-org/666/git/commits{/sha}","comments_url":"https://api.github.com/repos/shri-2015-org/666/comments{/number}","issue_comment_url":"https://api.github.com/repos/shri-2015-org/666/issues/comments{/number}","contents_url":"https://api.github.com/repos/shri-2015-org/666/contents/{+path}","compare_url":"https://api.github.com/repos/shri-2015-org/666/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shri-2015-org/666/merges","archive_url":"https://api.github.com/repos/shri-2015-org/666/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shri-2015-org/666/downloads","issues_url":"https://api.github.com/repos/shri-2015-org/666/issues{/number}","pulls_url":"https://api.github.com/repos/shri-2015-org/666/pulls{/number}","milestones_url":"https://api.github.com/repos/shri-2015-org/666/milestones{/number}","notifications_url":"https://api.github.com/repos/shri-2015-org/666/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shri-2015-org/666/labels{/name}","releases_url":"https://api.github.com/repos/shri-2015-org/666/releases{/id}","created_at":"2015-09-12T09:30:28Z","updated_at":"2015-09-21T09:57:03Z","pushed_at":"2015-10-04T18:22:45Z","git_url":"git://github.com/shri-2015-org/666.git","ssh_url":"git@github.com:shri-2015-org/666.git","clone_url":"https://github.com/shri-2015-org/666.git","svn_url":"https://github.com/shri-2015-org/666","homepage":"","size":2314,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":31,"forks":0,"open_issues":31,"watchers":1,"default_branch":"develop"}},"base":{"label":"shri-2015-org:pofigizm.restore","ref":"pofigizm.restore","sha":"afb45d33602c887b89904c492b320baad9075b14","user":{"login":"shri-2015-org","id":14175246,"avatar_url":"https://avatars.githubusercontent.com/u/14175246?v=3","gravatar_id":"","url":"https://api.github.com/users/shri-2015-org","html_url":"https://github.com/shri-2015-org","followers_url":"https://api.github.com/users/shri-2015-org/followers","following_url":"https://api.github.com/users/shri-2015-org/following{/other_user}","gists_url":"https://api.github.com/users/shri-2015-org/gists{/gist_id}","starred_url":"https://api.github.com/users/shri-2015-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shri-2015-org/subscriptions","organizations_url":"https://api.github.com/users/shri-2015-org/orgs","repos_url":"https://api.github.com/users/shri-2015-org/repos","events_url":"https://api.github.com/users/shri-2015-org/events{/privacy}","received_events_url":"https://api.github.com/users/shri-2015-org/received_events","type":"Organization","site_admin":false},"repo":{"id":42351789,"name":"666","full_name":"shri-2015-org/666","owner":{"login":"shri-2015-org","id":14175246,"avatar_url":"https://avatars.githubusercontent.com/u/14175246?v=3","gravatar_id":"","url":"https://api.github.com/users/shri-2015-org","html_url":"https://github.com/shri-2015-org","followers_url":"https://api.github.com/users/shri-2015-org/followers","following_url":"https://api.github.com/users/shri-2015-org/following{/other_user}","gists_url":"https://api.github.com/users/shri-2015-org/gists{/gist_id}","starred_url":"https://api.github.com/users/shri-2015-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shri-2015-org/subscriptions","organizations_url":"https://api.github.com/users/shri-2015-org/orgs","repos_url":"https://api.github.com/users/shri-2015-org/repos","events_url":"https://api.github.com/users/shri-2015-org/events{/privacy}","received_events_url":"https://api.github.com/users/shri-2015-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shri-2015-org/666","description":"666","fork":false,"url":"https://api.github.com/repos/shri-2015-org/666","forks_url":"https://api.github.com/repos/shri-2015-org/666/forks","keys_url":"https://api.github.com/repos/shri-2015-org/666/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shri-2015-org/666/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shri-2015-org/666/teams","hooks_url":"https://api.github.com/repos/shri-2015-org/666/hooks","issue_events_url":"https://api.github.com/repos/shri-2015-org/666/issues/events{/number}","events_url":"https://api.github.com/repos/shri-2015-org/666/events","assignees_url":"https://api.github.com/repos/shri-2015-org/666/assignees{/user}","branches_url":"https://api.github.com/repos/shri-2015-org/666/branches{/branch}","tags_url":"https://api.github.com/repos/shri-2015-org/666/tags","blobs_url":"https://api.github.com/repos/shri-2015-org/666/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shri-2015-org/666/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shri-2015-org/666/git/refs{/sha}","trees_url":"https://api.github.com/repos/shri-2015-org/666/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shri-2015-org/666/statuses/{sha}","languages_url":"https://api.github.com/repos/shri-2015-org/666/languages","stargazers_url":"https://api.github.com/repos/shri-2015-org/666/stargazers","contributors_url":"https://api.github.com/repos/shri-2015-org/666/contributors","subscribers_url":"https://api.github.com/repos/shri-2015-org/666/subscribers","subscription_url":"https://api.github.com/repos/shri-2015-org/666/subscription","commits_url":"https://api.github.com/repos/shri-2015-org/666/commits{/sha}","git_commits_url":"https://api.github.com/repos/shri-2015-org/666/git/commits{/sha}","comments_url":"https://api.github.com/repos/shri-2015-org/666/comments{/number}","issue_comment_url":"https://api.github.com/repos/shri-2015-org/666/issues/comments{/number}","contents_url":"https://api.github.com/repos/shri-2015-org/666/contents/{+path}","compare_url":"https://api.github.com/repos/shri-2015-org/666/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shri-2015-org/666/merges","archive_url":"https://api.github.com/repos/shri-2015-org/666/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shri-2015-org/666/downloads","issues_url":"https://api.github.com/repos/shri-2015-org/666/issues{/number}","pulls_url":"https://api.github.com/repos/shri-2015-org/666/pulls{/number}","milestones_url":"https://api.github.com/repos/shri-2015-org/666/milestones{/number}","notifications_url":"https://api.github.com/repos/shri-2015-org/666/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shri-2015-org/666/labels{/name}","releases_url":"https://api.github.com/repos/shri-2015-org/666/releases{/id}","created_at":"2015-09-12T09:30:28Z","updated_at":"2015-09-21T09:57:03Z","pushed_at":"2015-10-04T18:22:45Z","git_url":"git://github.com/shri-2015-org/666.git","ssh_url":"git@github.com:shri-2015-org/666.git","clone_url":"https://github.com/shri-2015-org/666.git","svn_url":"https://github.com/shri-2015-org/666","homepage":"","size":2314,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":31,"forks":0,"open_issues":31,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/shri-2015-org/666/pulls/125"},"html":{"href":"https://github.com/shri-2015-org/666/pull/125"},"issue":{"href":"https://api.github.com/repos/shri-2015-org/666/issues/125"},"comments":{"href":"https://api.github.com/repos/shri-2015-org/666/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/shri-2015-org/666/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/shri-2015-org/666/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shri-2015-org/666/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/shri-2015-org/666/statuses/c8b0494e4fc4bdf494a04d340ffee4ef5686b161"}}}}