{"action":"opened","number":196,"pull_request":{"url":"https://api.github.com/repos/rackt/react-redux/pulls/196","id":51374145,"html_url":"https://github.com/rackt/react-redux/pull/196","diff_url":"https://github.com/rackt/react-redux/pull/196.diff","patch_url":"https://github.com/rackt/react-redux/pull/196.patch","issue_url":"https://api.github.com/repos/rackt/react-redux/issues/196","number":196,"state":"open","locked":false,"title":"Prevent mapState from running twice when component is bound","user":{"login":"schmeedy","id":645661,"avatar_url":"https://avatars.githubusercontent.com/u/645661?v=3","gravatar_id":"","url":"https://api.github.com/users/schmeedy","html_url":"https://github.com/schmeedy","followers_url":"https://api.github.com/users/schmeedy/followers","following_url":"https://api.github.com/users/schmeedy/following{/other_user}","gists_url":"https://api.github.com/users/schmeedy/gists{/gist_id}","starred_url":"https://api.github.com/users/schmeedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmeedy/subscriptions","organizations_url":"https://api.github.com/users/schmeedy/orgs","repos_url":"https://api.github.com/users/schmeedy/repos","events_url":"https://api.github.com/users/schmeedy/events{/privacy}","received_events_url":"https://api.github.com/users/schmeedy/received_events","type":"User","site_admin":false},"body":"First, there's high probability this pull request is actually wrong and there's some fundamental thing in React / Redux that I violate by the proposed change given there are multiple unit tests which codify current approach. I still think there's some problem with it, though, so I appreciate if you look into this!\r\n\r\nI'm trying to prevent the `mapState` function from being called twice on each initial render of a \"connected component\" - first in the constructor and then right after that in `shouldComponentUpdate` where `stateProps` are recomputed because of difference in store state (as initially stored store state is always null). This second call can be avoided by simply initializing `this.state.storeState` with current store state during construction. \r\n\r\nIs this a viable solution? If not, is there some other way of preventing `mapState` to be called twice even though the state itself hasn't changed in between those two calls?","created_at":"2015-11-20T16:04:48Z","updated_at":"2015-11-20T16:04:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackt/react-redux/pulls/196/commits","review_comments_url":"https://api.github.com/repos/rackt/react-redux/pulls/196/comments","review_comment_url":"https://api.github.com/repos/rackt/react-redux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackt/react-redux/issues/196/comments","statuses_url":"https://api.github.com/repos/rackt/react-redux/statuses/7964c2f3fa6aa5af35592545b98704faf518773b","head":{"label":"schmeedy:master","ref":"master","sha":"7964c2f3fa6aa5af35592545b98704faf518773b","user":{"login":"schmeedy","id":645661,"avatar_url":"https://avatars.githubusercontent.com/u/645661?v=3","gravatar_id":"","url":"https://api.github.com/users/schmeedy","html_url":"https://github.com/schmeedy","followers_url":"https://api.github.com/users/schmeedy/followers","following_url":"https://api.github.com/users/schmeedy/following{/other_user}","gists_url":"https://api.github.com/users/schmeedy/gists{/gist_id}","starred_url":"https://api.github.com/users/schmeedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmeedy/subscriptions","organizations_url":"https://api.github.com/users/schmeedy/orgs","repos_url":"https://api.github.com/users/schmeedy/repos","events_url":"https://api.github.com/users/schmeedy/events{/privacy}","received_events_url":"https://api.github.com/users/schmeedy/received_events","type":"User","site_admin":false},"repo":{"id":46569641,"name":"react-redux","full_name":"schmeedy/react-redux","owner":{"login":"schmeedy","id":645661,"avatar_url":"https://avatars.githubusercontent.com/u/645661?v=3","gravatar_id":"","url":"https://api.github.com/users/schmeedy","html_url":"https://github.com/schmeedy","followers_url":"https://api.github.com/users/schmeedy/followers","following_url":"https://api.github.com/users/schmeedy/following{/other_user}","gists_url":"https://api.github.com/users/schmeedy/gists{/gist_id}","starred_url":"https://api.github.com/users/schmeedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmeedy/subscriptions","organizations_url":"https://api.github.com/users/schmeedy/orgs","repos_url":"https://api.github.com/users/schmeedy/repos","events_url":"https://api.github.com/users/schmeedy/events{/privacy}","received_events_url":"https://api.github.com/users/schmeedy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/schmeedy/react-redux","description":"Official React bindings for Redux","fork":true,"url":"https://api.github.com/repos/schmeedy/react-redux","forks_url":"https://api.github.com/repos/schmeedy/react-redux/forks","keys_url":"https://api.github.com/repos/schmeedy/react-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schmeedy/react-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schmeedy/react-redux/teams","hooks_url":"https://api.github.com/repos/schmeedy/react-redux/hooks","issue_events_url":"https://api.github.com/repos/schmeedy/react-redux/issues/events{/number}","events_url":"https://api.github.com/repos/schmeedy/react-redux/events","assignees_url":"https://api.github.com/repos/schmeedy/react-redux/assignees{/user}","branches_url":"https://api.github.com/repos/schmeedy/react-redux/branches{/branch}","tags_url":"https://api.github.com/repos/schmeedy/react-redux/tags","blobs_url":"https://api.github.com/repos/schmeedy/react-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schmeedy/react-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schmeedy/react-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/schmeedy/react-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schmeedy/react-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/schmeedy/react-redux/languages","stargazers_url":"https://api.github.com/repos/schmeedy/react-redux/stargazers","contributors_url":"https://api.github.com/repos/schmeedy/react-redux/contributors","subscribers_url":"https://api.github.com/repos/schmeedy/react-redux/subscribers","subscription_url":"https://api.github.com/repos/schmeedy/react-redux/subscription","commits_url":"https://api.github.com/repos/schmeedy/react-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/schmeedy/react-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/schmeedy/react-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/schmeedy/react-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/schmeedy/react-redux/contents/{+path}","compare_url":"https://api.github.com/repos/schmeedy/react-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schmeedy/react-redux/merges","archive_url":"https://api.github.com/repos/schmeedy/react-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schmeedy/react-redux/downloads","issues_url":"https://api.github.com/repos/schmeedy/react-redux/issues{/number}","pulls_url":"https://api.github.com/repos/schmeedy/react-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/schmeedy/react-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/schmeedy/react-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schmeedy/react-redux/labels{/name}","releases_url":"https://api.github.com/repos/schmeedy/react-redux/releases{/id}","created_at":"2015-11-20T15:21:02Z","updated_at":"2015-11-20T15:21:03Z","pushed_at":"2015-11-20T15:47:29Z","git_url":"git://github.com/schmeedy/react-redux.git","ssh_url":"git@github.com:schmeedy/react-redux.git","clone_url":"https://github.com/schmeedy/react-redux.git","svn_url":"https://github.com/schmeedy/react-redux","homepage":"http://rackt.github.io/redux/docs/basics/UsageWithReact.html","size":205,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rackt:master","ref":"master","sha":"b2b9f077600d6a648e75ba0bee38131baa68a58d","user":{"login":"rackt","id":8261421,"avatar_url":"https://avatars.githubusercontent.com/u/8261421?v=3","gravatar_id":"","url":"https://api.github.com/users/rackt","html_url":"https://github.com/rackt","followers_url":"https://api.github.com/users/rackt/followers","following_url":"https://api.github.com/users/rackt/following{/other_user}","gists_url":"https://api.github.com/users/rackt/gists{/gist_id}","starred_url":"https://api.github.com/users/rackt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackt/subscriptions","organizations_url":"https://api.github.com/users/rackt/orgs","repos_url":"https://api.github.com/users/rackt/repos","events_url":"https://api.github.com/users/rackt/events{/privacy}","received_events_url":"https://api.github.com/users/rackt/received_events","type":"Organization","site_admin":false},"repo":{"id":38934449,"name":"react-redux","full_name":"rackt/react-redux","owner":{"login":"rackt","id":8261421,"avatar_url":"https://avatars.githubusercontent.com/u/8261421?v=3","gravatar_id":"","url":"https://api.github.com/users/rackt","html_url":"https://github.com/rackt","followers_url":"https://api.github.com/users/rackt/followers","following_url":"https://api.github.com/users/rackt/following{/other_user}","gists_url":"https://api.github.com/users/rackt/gists{/gist_id}","starred_url":"https://api.github.com/users/rackt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackt/subscriptions","organizations_url":"https://api.github.com/users/rackt/orgs","repos_url":"https://api.github.com/users/rackt/repos","events_url":"https://api.github.com/users/rackt/events{/privacy}","received_events_url":"https://api.github.com/users/rackt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackt/react-redux","description":"Official React bindings for Redux","fork":false,"url":"https://api.github.com/repos/rackt/react-redux","forks_url":"https://api.github.com/repos/rackt/react-redux/forks","keys_url":"https://api.github.com/repos/rackt/react-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackt/react-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackt/react-redux/teams","hooks_url":"https://api.github.com/repos/rackt/react-redux/hooks","issue_events_url":"https://api.github.com/repos/rackt/react-redux/issues/events{/number}","events_url":"https://api.github.com/repos/rackt/react-redux/events","assignees_url":"https://api.github.com/repos/rackt/react-redux/assignees{/user}","branches_url":"https://api.github.com/repos/rackt/react-redux/branches{/branch}","tags_url":"https://api.github.com/repos/rackt/react-redux/tags","blobs_url":"https://api.github.com/repos/rackt/react-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackt/react-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackt/react-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackt/react-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackt/react-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/rackt/react-redux/languages","stargazers_url":"https://api.github.com/repos/rackt/react-redux/stargazers","contributors_url":"https://api.github.com/repos/rackt/react-redux/contributors","subscribers_url":"https://api.github.com/repos/rackt/react-redux/subscribers","subscription_url":"https://api.github.com/repos/rackt/react-redux/subscription","commits_url":"https://api.github.com/repos/rackt/react-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackt/react-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackt/react-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackt/react-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackt/react-redux/contents/{+path}","compare_url":"https://api.github.com/repos/rackt/react-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackt/react-redux/merges","archive_url":"https://api.github.com/repos/rackt/react-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackt/react-redux/downloads","issues_url":"https://api.github.com/repos/rackt/react-redux/issues{/number}","pulls_url":"https://api.github.com/repos/rackt/react-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/rackt/react-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/rackt/react-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackt/react-redux/labels{/name}","releases_url":"https://api.github.com/repos/rackt/react-redux/releases{/id}","created_at":"2015-07-11T17:32:01Z","updated_at":"2015-11-20T11:44:55Z","pushed_at":"2015-11-19T20:20:04Z","git_url":"git://github.com/rackt/react-redux.git","ssh_url":"git@github.com:rackt/react-redux.git","clone_url":"https://github.com/rackt/react-redux.git","svn_url":"https://github.com/rackt/react-redux","homepage":"http://rackt.github.io/redux/docs/basics/UsageWithReact.html","size":1106,"stargazers_count":1245,"watchers_count":1245,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":137,"mirror_url":null,"open_issues_count":8,"forks":137,"open_issues":8,"watchers":1245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackt/react-redux/pulls/196"},"html":{"href":"https://github.com/rackt/react-redux/pull/196"},"issue":{"href":"https://api.github.com/repos/rackt/react-redux/issues/196"},"comments":{"href":"https://api.github.com/repos/rackt/react-redux/issues/196/comments"},"review_comments":{"href":"https://api.github.com/repos/rackt/react-redux/pulls/196/comments"},"review_comment":{"href":"https://api.github.com/repos/rackt/react-redux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackt/react-redux/pulls/196/commits"},"statuses":{"href":"https://api.github.com/repos/rackt/react-redux/statuses/7964c2f3fa6aa5af35592545b98704faf518773b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":11,"deletions":11,"changed_files":2}}