{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/178421092","pull_request_review_id":108481089,"id":178421092,"diff_hunk":"@@ -160,22 +160,22 @@ case SHOW_DATA_ACTION: (state, data) => {\n ...\r\n ```\r\n \r\n-No, this infinite loop **won’t** cause a stack overflow and **won’t** crash your client! Since the ‘take’ effect is acting like a thread sleep, the execution of ‘mySaga’ is pending until the specified action is dispatched. This acts the same after the code re-enters the loop.\r\n+这个无限循环**不会**造成堆栈溢出，**也不会**使你的应用崩溃！因为 `take` 方法就像线程挂起一样，`mySaga` 执行后会一直保持 `pending` 状态，直到那个 action 被触发。下次重新进入循环后，也会重复上述过程。\r\n \r\n-Let’s go over the flow, step by step:\r\n-1. Application starts, and runs all of it’s existing Sagas.\r\n-2. _mySaga_ runs, enters the ‘_while (true)_’ loop, and is “sleeping” on line 3.\r\n-3. ‘_USER_INTERACTED_WITH_UI_ACTION’_ action is dispatched.\r\n-4. Saga’s ‘thread’ is waking up and moves to line 4, where it emits ‘_SHOW_LOADING_ACTION_’ for the reducer to handle (the reducer will now probably cause the view to show some loading indication).\r\n-5. We send a request to the server (line 5), and “sleep” until the promise is resolved with content that is stored in the ‘data’ variable.\r\n-6. ‘SHOW_DATA_ACTION’ is dispatched with the received data, so now the reducer can use it for updating the view.\r\n-7. We enter the loop again, and go back to the second step.\r\n+让我们一步步地看一下上面的过程：\r\n+1. 应用启动，执行所有 Sagas。\r\n+2. **mySaga** 运行，进入 `while(true)` 循环，在第 3 行挂起。\r\n+3. `USER_INTERACTED_WITH_UI_ACTION` 这个 action 被触发。\r\n+4. Saga 的线程激活，执行第 4 行，触发 `SHOW_LOADING_ACTION` 这个 action，然后分配的 reducer 进行处理（reducer 处理后，页面就会显示 loading 提示）。\r\n+5. 发送一个请求（第 5 行），然后会再次挂起，直到请求的 Promise 变为 resolved，请求结果的数据会赋值给 data 变量。\r","path":"TODO1/dont-call-me-i-ll-call-you-side-effects-management-with-redux-saga-part-1.md","position":168,"original_position":168,"commit_id":"4272f8f6980ec0e637bf7d3adee10a4c9c18d479","original_commit_id":"4272f8f6980ec0e637bf7d3adee10a4c9c18d479","user":{"login":"ClarenceC","id":25650959,"avatar_url":"https://avatars0.githubusercontent.com/u/25650959?v=4","gravatar_id":"","url":"https://api.github.com/users/ClarenceC","html_url":"https://github.com/ClarenceC","followers_url":"https://api.github.com/users/ClarenceC/followers","following_url":"https://api.github.com/users/ClarenceC/following{/other_user}","gists_url":"https://api.github.com/users/ClarenceC/gists{/gist_id}","starred_url":"https://api.github.com/users/ClarenceC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClarenceC/subscriptions","organizations_url":"https://api.github.com/users/ClarenceC/orgs","repos_url":"https://api.github.com/users/ClarenceC/repos","events_url":"https://api.github.com/users/ClarenceC/events{/privacy}","received_events_url":"https://api.github.com/users/ClarenceC/received_events","type":"User","site_admin":false},"body":"『发送一个请求（第 5 行）』=> 『发送一个请求到服务端（第 5 行）』","created_at":"2018-03-31T02:39:35Z","updated_at":"2018-03-31T02:40:59Z","html_url":"https://github.com/xitu/gold-miner/pull/3552#discussion_r178421092","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3552","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/178421092"},"html":{"href":"https://github.com/xitu/gold-miner/pull/3552#discussion_r178421092"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3552"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/3552","id":178212909,"html_url":"https://github.com/xitu/gold-miner/pull/3552","diff_url":"https://github.com/xitu/gold-miner/pull/3552.diff","patch_url":"https://github.com/xitu/gold-miner/pull/3552.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/3552","number":3552,"state":"open","locked":false,"title":"等我通知：使用 Redux-Saga 管理 React 应用中的异步 action （上）","user":{"login":"jonjia","id":20496707,"avatar_url":"https://avatars3.githubusercontent.com/u/20496707?v=4","gravatar_id":"","url":"https://api.github.com/users/jonjia","html_url":"https://github.com/jonjia","followers_url":"https://api.github.com/users/jonjia/followers","following_url":"https://api.github.com/users/jonjia/following{/other_user}","gists_url":"https://api.github.com/users/jonjia/gists{/gist_id}","starred_url":"https://api.github.com/users/jonjia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonjia/subscriptions","organizations_url":"https://api.github.com/users/jonjia/orgs","repos_url":"https://api.github.com/users/jonjia/repos","events_url":"https://api.github.com/users/jonjia/events{/privacy}","received_events_url":"https://api.github.com/users/jonjia/received_events","type":"User","site_admin":false},"body":"译文翻译完成，resolve #3496 \r\n","created_at":"2018-03-29T02:36:46Z","updated_at":"2018-03-31T02:40:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a431aa9290ecb29cb744a810f9ec097ab1fe639","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":514335594,"url":"https://api.github.com/repos/xitu/gold-miner/labels/%E5%89%8D%E7%AB%AF","name":"前端","color":"1d76db","default":false},{"id":322084033,"url":"https://api.github.com/repos/xitu/gold-miner/labels/%E6%AD%A3%E5%9C%A8%E6%A0%A1%E5%AF%B9","name":"正在校对","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3552/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3552/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/3552/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/4272f8f6980ec0e637bf7d3adee10a4c9c18d479","head":{"label":"jonjia:dont-call-me-i-ll-call-you-side-effects-management-with-redux-saga-part-1","ref":"dont-call-me-i-ll-call-you-side-effects-management-with-redux-saga-part-1","sha":"4272f8f6980ec0e637bf7d3adee10a4c9c18d479","user":{"login":"jonjia","id":20496707,"avatar_url":"https://avatars3.githubusercontent.com/u/20496707?v=4","gravatar_id":"","url":"https://api.github.com/users/jonjia","html_url":"https://github.com/jonjia","followers_url":"https://api.github.com/users/jonjia/followers","following_url":"https://api.github.com/users/jonjia/following{/other_user}","gists_url":"https://api.github.com/users/jonjia/gists{/gist_id}","starred_url":"https://api.github.com/users/jonjia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonjia/subscriptions","organizations_url":"https://api.github.com/users/jonjia/orgs","repos_url":"https://api.github.com/users/jonjia/repos","events_url":"https://api.github.com/users/jonjia/events{/privacy}","received_events_url":"https://api.github.com/users/jonjia/received_events","type":"User","site_admin":false},"repo":{"id":113727017,"name":"gold-miner","full_name":"jonjia/gold-miner","owner":{"login":"jonjia","id":20496707,"avatar_url":"https://avatars3.githubusercontent.com/u/20496707?v=4","gravatar_id":"","url":"https://api.github.com/users/jonjia","html_url":"https://github.com/jonjia","followers_url":"https://api.github.com/users/jonjia/followers","following_url":"https://api.github.com/users/jonjia/following{/other_user}","gists_url":"https://api.github.com/users/jonjia/gists{/gist_id}","starred_url":"https://api.github.com/users/jonjia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonjia/subscriptions","organizations_url":"https://api.github.com/users/jonjia/orgs","repos_url":"https://api.github.com/users/jonjia/repos","events_url":"https://api.github.com/users/jonjia/events{/privacy}","received_events_url":"https://api.github.com/users/jonjia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonjia/gold-miner","description":"🥇掘金翻译计划，可能是世界最大最好的英译中技术社区，最懂读者和译者的翻译平台：","fork":true,"url":"https://api.github.com/repos/jonjia/gold-miner","forks_url":"https://api.github.com/repos/jonjia/gold-miner/forks","keys_url":"https://api.github.com/repos/jonjia/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonjia/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonjia/gold-miner/teams","hooks_url":"https://api.github.com/repos/jonjia/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/jonjia/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/jonjia/gold-miner/events","assignees_url":"https://api.github.com/repos/jonjia/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/jonjia/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/jonjia/gold-miner/tags","blobs_url":"https://api.github.com/repos/jonjia/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonjia/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonjia/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonjia/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonjia/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/jonjia/gold-miner/languages","stargazers_url":"https://api.github.com/repos/jonjia/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/jonjia/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/jonjia/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/jonjia/gold-miner/subscription","commits_url":"https://api.github.com/repos/jonjia/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonjia/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonjia/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonjia/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonjia/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/jonjia/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonjia/gold-miner/merges","archive_url":"https://api.github.com/repos/jonjia/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonjia/gold-miner/downloads","issues_url":"https://api.github.com/repos/jonjia/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/jonjia/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/jonjia/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/jonjia/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonjia/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/jonjia/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/jonjia/gold-miner/deployments","created_at":"2017-12-10T05:54:21Z","updated_at":"2018-03-23T03:11:05Z","pushed_at":"2018-03-30T06:55:48Z","git_url":"git://github.com/jonjia/gold-miner.git","ssh_url":"git@github.com:jonjia/gold-miner.git","clone_url":"https://github.com/jonjia/gold-miner.git","svn_url":"https://github.com/jonjia/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":30841,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"26dea5e0a76dc6c9833936e68f5fc674491ae3e2","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"🥇掘金翻译计划，可能是世界最大最好的英译中技术社区，最懂读者和译者的翻译平台：","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/gold-miner/deployments","created_at":"2015-11-04T03:29:13Z","updated_at":"2018-03-31T02:35:53Z","pushed_at":"2018-03-30T23:04:32Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":31026,"stargazers_count":12823,"watchers_count":12823,"language":null,"has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2304,"mirror_url":null,"archived":false,"open_issues_count":32,"license":null,"forks":2304,"open_issues":32,"watchers":12823,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3552"},"html":{"href":"https://github.com/xitu/gold-miner/pull/3552"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/3552"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/3552/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3552/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3552/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/4272f8f6980ec0e637bf7d3adee10a4c9c18d479"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ClarenceC"}}