{"action":"created","comment":{"url":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/comments/41610251","id":41610251,"diff_hunk":"@@ -290,13 +290,13 @@ React.render(\n );\n ```\n \n-This makes our store instance available to the components below. (Internally, this is done via React [undocumented “context” feature](http://www.youtube.com/watch?v=H7vlH-wntD4), but it’s not exposed directly in the API so don’t worry about it.)\n+这使得我们的store能为下面的组件所用。（在内部，这个是通过React的 [非文件“环境”特性](http://www.youtube.com/watch?v=H7vlH-wntD4) 完成的，但它不直接暴露API，所以不用担心。）\n \n-Then, we **wrap the components we want to connect to Redux with `connect()` function from [`react-redux`](http://github.com/gaearon/react-redux)**. Try to only do this for a top-level component, or route handlers. While technically you can `connect()` any component in your app to Redux store, avoid doing this too deeply because it will make the data flow harder to trace.\n+接着，我们**想要通过 [`react-redux`](http://github.com/gaearon/react-redux) 提供的 `connect()` 方法将包装好的组件连接到Redux**。尽量只做一个顶层的组件，或者route处理。从技术上来说你可以将应用中的任何一个组件 `connect()` 到Redux store中，但尽量要避免这么做，因为这个数据流很难追踪。\n \n-**Any component wrapped with `connect()` call will receive a [`dispatch`](../api/Store.md#dispatch) function as a prop, and any state it needs from the global state.** The only argument to `connect()` is a function we call a **selector**. This function takes the global Redux store’s state, and returns the props you need for the component. In the simplest case, you can just return the `state` given to you, but you may also wish to transform it first.\n+**任何一个从 `contect()` 包装好的组件都可以得到一个像prop的 [`dispatch`](../api/Store.md#dispatch) 方法。** `connect()` 的唯一参数是**selector**。此方法可以从Redux store接收到全局的state，然后返回一个你的组件中需要的props。最简单的情况下，可以返回一个初始的 `state` ,但你可能希望它发生了变化。","path":"docs/basics/UsageWithReact.md","position":34,"original_position":34,"commit_id":"31935b74265b75d1750ee06372d6a700f1ff52af","original_commit_id":"31935b74265b75d1750ee06372d6a700f1ff52af","user":{"login":"jovey-zheng","id":9565245,"avatar_url":"https://avatars.githubusercontent.com/u/9565245?v=3","gravatar_id":"","url":"https://api.github.com/users/jovey-zheng","html_url":"https://github.com/jovey-zheng","followers_url":"https://api.github.com/users/jovey-zheng/followers","following_url":"https://api.github.com/users/jovey-zheng/following{/other_user}","gists_url":"https://api.github.com/users/jovey-zheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jovey-zheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jovey-zheng/subscriptions","organizations_url":"https://api.github.com/users/jovey-zheng/orgs","repos_url":"https://api.github.com/users/jovey-zheng/repos","events_url":"https://api.github.com/users/jovey-zheng/events{/privacy}","received_events_url":"https://api.github.com/users/jovey-zheng/received_events","type":"User","site_admin":false},"body":"那这句\r\n> receive a dispatch function as a prop\r\n就译成你说的吧。","created_at":"2015-10-09T09:01:17Z","updated_at":"2015-10-09T09:01:17Z","html_url":"https://github.com/camsong/redux-in-chinese/pull/28#discussion_r41610251","pull_request_url":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/comments/41610251"},"html":{"href":"https://github.com/camsong/redux-in-chinese/pull/28#discussion_r41610251"},"pull_request":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28","id":47242984,"html_url":"https://github.com/camsong/redux-in-chinese/pull/28","diff_url":"https://github.com/camsong/redux-in-chinese/pull/28.diff","patch_url":"https://github.com/camsong/redux-in-chinese/pull/28.patch","issue_url":"https://api.github.com/repos/camsong/redux-in-chinese/issues/28","number":28,"state":"open","locked":false,"title":"translate docs/basics/UsageWithReact.md-Connecting to Redux","user":{"login":"jovey-zheng","id":9565245,"avatar_url":"https://avatars.githubusercontent.com/u/9565245?v=3","gravatar_id":"","url":"https://api.github.com/users/jovey-zheng","html_url":"https://github.com/jovey-zheng","followers_url":"https://api.github.com/users/jovey-zheng/followers","following_url":"https://api.github.com/users/jovey-zheng/following{/other_user}","gists_url":"https://api.github.com/users/jovey-zheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jovey-zheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jovey-zheng/subscriptions","organizations_url":"https://api.github.com/users/jovey-zheng/orgs","repos_url":"https://api.github.com/users/jovey-zheng/repos","events_url":"https://api.github.com/users/jovey-zheng/events{/privacy}","received_events_url":"https://api.github.com/users/jovey-zheng/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-09T07:50:06Z","updated_at":"2015-10-09T09:01:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2c95f2c0b60fa307c456749ee881514bf307cd9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28/commits","review_comments_url":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28/comments","review_comment_url":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/comments{/number}","comments_url":"https://api.github.com/repos/camsong/redux-in-chinese/issues/28/comments","statuses_url":"https://api.github.com/repos/camsong/redux-in-chinese/statuses/31935b74265b75d1750ee06372d6a700f1ff52af","head":{"label":"jovey-zheng:master","ref":"master","sha":"31935b74265b75d1750ee06372d6a700f1ff52af","user":{"login":"jovey-zheng","id":9565245,"avatar_url":"https://avatars.githubusercontent.com/u/9565245?v=3","gravatar_id":"","url":"https://api.github.com/users/jovey-zheng","html_url":"https://github.com/jovey-zheng","followers_url":"https://api.github.com/users/jovey-zheng/followers","following_url":"https://api.github.com/users/jovey-zheng/following{/other_user}","gists_url":"https://api.github.com/users/jovey-zheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jovey-zheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jovey-zheng/subscriptions","organizations_url":"https://api.github.com/users/jovey-zheng/orgs","repos_url":"https://api.github.com/users/jovey-zheng/repos","events_url":"https://api.github.com/users/jovey-zheng/events{/privacy}","received_events_url":"https://api.github.com/users/jovey-zheng/received_events","type":"User","site_admin":false},"repo":{"id":43419957,"name":"redux-in-chinese","full_name":"jovey-zheng/redux-in-chinese","owner":{"login":"jovey-zheng","id":9565245,"avatar_url":"https://avatars.githubusercontent.com/u/9565245?v=3","gravatar_id":"","url":"https://api.github.com/users/jovey-zheng","html_url":"https://github.com/jovey-zheng","followers_url":"https://api.github.com/users/jovey-zheng/followers","following_url":"https://api.github.com/users/jovey-zheng/following{/other_user}","gists_url":"https://api.github.com/users/jovey-zheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jovey-zheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jovey-zheng/subscriptions","organizations_url":"https://api.github.com/users/jovey-zheng/orgs","repos_url":"https://api.github.com/users/jovey-zheng/repos","events_url":"https://api.github.com/users/jovey-zheng/events{/privacy}","received_events_url":"https://api.github.com/users/jovey-zheng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jovey-zheng/redux-in-chinese","description":"Redux 官方文档中文翻译","fork":true,"url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese","forks_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/forks","keys_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/teams","hooks_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/hooks","issue_events_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/issues/events{/number}","events_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/events","assignees_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/assignees{/user}","branches_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/branches{/branch}","tags_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/tags","blobs_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/git/refs{/sha}","trees_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/statuses/{sha}","languages_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/languages","stargazers_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/stargazers","contributors_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/contributors","subscribers_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/subscribers","subscription_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/subscription","commits_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/commits{/sha}","git_commits_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/git/commits{/sha}","comments_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/comments{/number}","issue_comment_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/issues/comments{/number}","contents_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/contents/{+path}","compare_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/merges","archive_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/downloads","issues_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/issues{/number}","pulls_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/pulls{/number}","milestones_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/milestones{/number}","notifications_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/labels{/name}","releases_url":"https://api.github.com/repos/jovey-zheng/redux-in-chinese/releases{/id}","created_at":"2015-09-30T08:00:34Z","updated_at":"2015-09-30T07:33:35Z","pushed_at":"2015-10-09T07:48:45Z","git_url":"git://github.com/jovey-zheng/redux-in-chinese.git","ssh_url":"git@github.com:jovey-zheng/redux-in-chinese.git","clone_url":"https://github.com/jovey-zheng/redux-in-chinese.git","svn_url":"https://github.com/jovey-zheng/redux-in-chinese","homepage":"http://camsong.github.io/redux-in-chinese/","size":954,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"camsong:master","ref":"master","sha":"6443710d3f67c0ee89d4a3f8aa4b2a9f987f8836","user":{"login":"camsong","id":948896,"avatar_url":"https://avatars.githubusercontent.com/u/948896?v=3","gravatar_id":"","url":"https://api.github.com/users/camsong","html_url":"https://github.com/camsong","followers_url":"https://api.github.com/users/camsong/followers","following_url":"https://api.github.com/users/camsong/following{/other_user}","gists_url":"https://api.github.com/users/camsong/gists{/gist_id}","starred_url":"https://api.github.com/users/camsong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsong/subscriptions","organizations_url":"https://api.github.com/users/camsong/orgs","repos_url":"https://api.github.com/users/camsong/repos","events_url":"https://api.github.com/users/camsong/events{/privacy}","received_events_url":"https://api.github.com/users/camsong/received_events","type":"User","site_admin":false},"repo":{"id":40458061,"name":"redux-in-chinese","full_name":"camsong/redux-in-chinese","owner":{"login":"camsong","id":948896,"avatar_url":"https://avatars.githubusercontent.com/u/948896?v=3","gravatar_id":"","url":"https://api.github.com/users/camsong","html_url":"https://github.com/camsong","followers_url":"https://api.github.com/users/camsong/followers","following_url":"https://api.github.com/users/camsong/following{/other_user}","gists_url":"https://api.github.com/users/camsong/gists{/gist_id}","starred_url":"https://api.github.com/users/camsong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsong/subscriptions","organizations_url":"https://api.github.com/users/camsong/orgs","repos_url":"https://api.github.com/users/camsong/repos","events_url":"https://api.github.com/users/camsong/events{/privacy}","received_events_url":"https://api.github.com/users/camsong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/camsong/redux-in-chinese","description":"Redux 官方文档中文翻译","fork":false,"url":"https://api.github.com/repos/camsong/redux-in-chinese","forks_url":"https://api.github.com/repos/camsong/redux-in-chinese/forks","keys_url":"https://api.github.com/repos/camsong/redux-in-chinese/keys{/key_id}","collaborators_url":"https://api.github.com/repos/camsong/redux-in-chinese/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/camsong/redux-in-chinese/teams","hooks_url":"https://api.github.com/repos/camsong/redux-in-chinese/hooks","issue_events_url":"https://api.github.com/repos/camsong/redux-in-chinese/issues/events{/number}","events_url":"https://api.github.com/repos/camsong/redux-in-chinese/events","assignees_url":"https://api.github.com/repos/camsong/redux-in-chinese/assignees{/user}","branches_url":"https://api.github.com/repos/camsong/redux-in-chinese/branches{/branch}","tags_url":"https://api.github.com/repos/camsong/redux-in-chinese/tags","blobs_url":"https://api.github.com/repos/camsong/redux-in-chinese/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/camsong/redux-in-chinese/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/camsong/redux-in-chinese/git/refs{/sha}","trees_url":"https://api.github.com/repos/camsong/redux-in-chinese/git/trees{/sha}","statuses_url":"https://api.github.com/repos/camsong/redux-in-chinese/statuses/{sha}","languages_url":"https://api.github.com/repos/camsong/redux-in-chinese/languages","stargazers_url":"https://api.github.com/repos/camsong/redux-in-chinese/stargazers","contributors_url":"https://api.github.com/repos/camsong/redux-in-chinese/contributors","subscribers_url":"https://api.github.com/repos/camsong/redux-in-chinese/subscribers","subscription_url":"https://api.github.com/repos/camsong/redux-in-chinese/subscription","commits_url":"https://api.github.com/repos/camsong/redux-in-chinese/commits{/sha}","git_commits_url":"https://api.github.com/repos/camsong/redux-in-chinese/git/commits{/sha}","comments_url":"https://api.github.com/repos/camsong/redux-in-chinese/comments{/number}","issue_comment_url":"https://api.github.com/repos/camsong/redux-in-chinese/issues/comments{/number}","contents_url":"https://api.github.com/repos/camsong/redux-in-chinese/contents/{+path}","compare_url":"https://api.github.com/repos/camsong/redux-in-chinese/compare/{base}...{head}","merges_url":"https://api.github.com/repos/camsong/redux-in-chinese/merges","archive_url":"https://api.github.com/repos/camsong/redux-in-chinese/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/camsong/redux-in-chinese/downloads","issues_url":"https://api.github.com/repos/camsong/redux-in-chinese/issues{/number}","pulls_url":"https://api.github.com/repos/camsong/redux-in-chinese/pulls{/number}","milestones_url":"https://api.github.com/repos/camsong/redux-in-chinese/milestones{/number}","notifications_url":"https://api.github.com/repos/camsong/redux-in-chinese/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/camsong/redux-in-chinese/labels{/name}","releases_url":"https://api.github.com/repos/camsong/redux-in-chinese/releases{/id}","created_at":"2015-08-10T01:57:51Z","updated_at":"2015-10-09T06:27:59Z","pushed_at":"2015-10-09T08:55:07Z","git_url":"git://github.com/camsong/redux-in-chinese.git","ssh_url":"git@github.com:camsong/redux-in-chinese.git","clone_url":"https://github.com/camsong/redux-in-chinese.git","svn_url":"https://github.com/camsong/redux-in-chinese","homepage":"http://camsong.github.io/redux-in-chinese/","size":1205,"stargazers_count":275,"watchers_count":275,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":31,"mirror_url":null,"open_issues_count":2,"forks":31,"open_issues":2,"watchers":275,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28"},"html":{"href":"https://github.com/camsong/redux-in-chinese/pull/28"},"issue":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/issues/28"},"comments":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/camsong/redux-in-chinese/statuses/31935b74265b75d1750ee06372d6a700f1ff52af"}}}}