{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/81200070","pull_request_review_id":2197776,"id":81200070,"diff_hunk":"@@ -0,0 +1,32 @@\n+/**\n+ * External dependencies\n+ */\n+import { combineReducers } from 'redux';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import {\n+\tCOUNTRY_STATES_RECEIVE,\n+\tCOUNTRY_STATES_REQUEST,\n+\tCOUNTRY_STATES_REQUEST_FAILURE,\n+} from 'state/action-types';\n+import { itemSchema } from './schema';\n+import { createReducer } from 'state/utils';\n+\n+// Stores the complete list of states, indexed by locale key\n+export const items = createReducer( {}, {\n+\t[ COUNTRY_STATES_RECEIVE ]: ( state, action ) => ( { ...state, [ action.countryCode ]: action.countryStates } ),\n+}, itemSchema );\n+\n+// Tracks states list fetching state\n+export const isFetching = createReducer( {}, {\n+\t[ COUNTRY_STATES_REQUEST ]: ( state, { countryCode } ) => ( { ...state, [ countryCode ]: true } ),\n+\t[ COUNTRY_STATES_RECEIVE ]: ( state, { countryCode } ) => ( { ...state, [ countryCode ]: false } ),","path":"client/state/country-states/reducer.js","position":25,"original_position":25,"commit_id":"bca5dba1488ccc16e2564d22f113e9ea7e9f9b41","original_commit_id":"bca5dba1488ccc16e2564d22f113e9ea7e9f9b41","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"body":"Part of the idea with a separate `receiveCountryStates` action creator is that it allows for states to be received from any source, not specifically tied to the request from `requestCountryStates`. This is why in other subtrees we'll have a separate action type. In this case that would be `COUNTRY_STATES_REQUEST_SUCCESS`.","created_at":"2016-09-29T18:11:51Z","updated_at":"2016-09-29T18:13:53Z","html_url":"https://github.com/Automattic/wp-calypso/pull/8202#discussion_r81200070","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/81200070"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/8202#discussion_r81200070"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202","id":86794474,"html_url":"https://github.com/Automattic/wp-calypso/pull/8202","diff_url":"https://github.com/Automattic/wp-calypso/pull/8202.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/8202.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8202","number":8202,"state":"open","locked":false,"title":"Reduxifyed States List","user":{"login":"obenland","id":1398304,"avatar_url":"https://avatars.githubusercontent.com/u/1398304?v=3","gravatar_id":"","url":"https://api.github.com/users/obenland","html_url":"https://github.com/obenland","followers_url":"https://api.github.com/users/obenland/followers","following_url":"https://api.github.com/users/obenland/following{/other_user}","gists_url":"https://api.github.com/users/obenland/gists{/gist_id}","starred_url":"https://api.github.com/users/obenland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obenland/subscriptions","organizations_url":"https://api.github.com/users/obenland/orgs","repos_url":"https://api.github.com/users/obenland/repos","events_url":"https://api.github.com/users/obenland/events{/privacy}","received_events_url":"https://api.github.com/users/obenland/received_events","type":"User","site_admin":false},"body":"In my first pass at a reduxified states list I added actions, reducers, selectors, and corresponding tests.\r\n\r\nI'm thinking this could be a query component that updates state for other components that use it?\r\n\r\nFixes #7922.","created_at":"2016-09-26T18:30:55Z","updated_at":"2016-09-29T18:13:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7902b211e7334bdeef2460ebddc155a75c75869","assignee":{"login":"obenland","id":1398304,"avatar_url":"https://avatars.githubusercontent.com/u/1398304?v=3","gravatar_id":"","url":"https://api.github.com/users/obenland","html_url":"https://github.com/obenland","followers_url":"https://api.github.com/users/obenland/followers","following_url":"https://api.github.com/users/obenland/following{/other_user}","gists_url":"https://api.github.com/users/obenland/gists{/gist_id}","starred_url":"https://api.github.com/users/obenland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obenland/subscriptions","organizations_url":"https://api.github.com/users/obenland/orgs","repos_url":"https://api.github.com/users/obenland/repos","events_url":"https://api.github.com/users/obenland/events{/privacy}","received_events_url":"https://api.github.com/users/obenland/received_events","type":"User","site_admin":false},"assignees":[{"login":"obenland","id":1398304,"avatar_url":"https://avatars.githubusercontent.com/u/1398304?v=3","gravatar_id":"","url":"https://api.github.com/users/obenland","html_url":"https://github.com/obenland","followers_url":"https://api.github.com/users/obenland/followers","following_url":"https://api.github.com/users/obenland/following{/other_user}","gists_url":"https://api.github.com/users/obenland/gists{/gist_id}","starred_url":"https://api.github.com/users/obenland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obenland/subscriptions","organizations_url":"https://api.github.com/users/obenland/orgs","repos_url":"https://api.github.com/users/obenland/repos","events_url":"https://api.github.com/users/obenland/events{/privacy}","received_events_url":"https://api.github.com/users/obenland/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8202/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/bca5dba1488ccc16e2564d22f113e9ea7e9f9b41","head":{"label":"Automattic:update/7922-states-list-redux","ref":"update/7922-states-list-redux","sha":"bca5dba1488ccc16e2564d22f113e9ea7e9f9b41","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-09-29T05:52:37Z","pushed_at":"2016-09-29T18:13:49Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":120741,"stargazers_count":7862,"watchers_count":7862,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":985,"mirror_url":null,"open_issues_count":1534,"forks":985,"open_issues":1534,"watchers":7862,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"62ef21ee7ab6dce26035b7952674545e4dee86fd","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-09-29T05:52:37Z","pushed_at":"2016-09-29T18:13:49Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":120741,"stargazers_count":7862,"watchers_count":7862,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":985,"mirror_url":null,"open_issues_count":1534,"forks":985,"open_issues":1534,"watchers":7862,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/8202"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/8202"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/8202/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8202/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/bca5dba1488ccc16e2564d22f113e9ea7e9f9b41"}}}}
{"actor":{"display_login":"aduth"}}