{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/69083392","id":69083392,"diff_hunk":"@@ -109,65 +110,60 @@ function updatePurchases( existingPurchases, action ) {\n \treturn purchases;\n }\n \n-export const items = ( state = initialState, action ) => {\n-\tconst { type } = action;\n-\n-\tswitch ( type ) {\n-\t\tcase PURCHASES_REMOVE:\n-\t\t\treturn { ...state,\n-\t\t\t\tdata: [],\n-\t\t\t\thasLoadedSitePurchasesFromServer: false,\n-\t\t\t\thasLoadedUserPurchasesFromServer: false\n-\t\t\t};\n-\t\tcase PURCHASE_REMOVE:\n-\t\t\treturn { ...state,\n-\t\t\t\tdata: [],\n-\t\t\t\tisFetchingSitePurchases: false,\n-\t\t\t\tisFetchingUserPurchases: false\n-\t\t\t};\n-\t\tcase PURCHASES_SITE_FETCH:\n-\t\t\treturn { ...state, isFetchingSitePurchases: true };\n-\t\tcase PURCHASES_USER_FETCH:\n-\t\t\treturn { ...state, isFetchingUserPurchases: true };\n-\n-\t\tcase PURCHASE_REMOVE_COMPLETED:\n-\t\t\treturn { ...state,\n-\t\t\t\tdata: updatePurchases( state.data, action ),\n-\t\t\t\terror: null,\n-\t\t\t\tisFetchingSitePurchases: false,\n-\t\t\t\tisFetchingUserPurchases: false,\n-\t\t\t\thasLoadedSitePurchasesFromServer: true,\n-\t\t\t\thasLoadedUserPurchasesFromServer: true\n-\t\t\t};\n-\t\tcase PURCHASES_SITE_FETCH_COMPLETED:\n-\t\t\treturn { ...state,\n-\t\t\t\tdata: updatePurchases( state.data, action ),\n-\t\t\t\terror: null,\n-\t\t\t\tisFetchingSitePurchases: false,\n-\t\t\t\thasLoadedSitePurchasesFromServer: true\n-\t\t\t};\n-\t\tcase PURCHASES_USER_FETCH_COMPLETED:\n-\t\t\treturn { ...state,\n-\t\t\t\tdata: updatePurchases( state.data, action ),\n-\t\t\t\terror: null,\n-\t\t\t\tisFetchingUserPurchases: false,\n-\t\t\t\thasLoadedUserPurchasesFromServer: true\n-\t\t\t};\n-\n-\t\tcase PURCHASE_REMOVE_FAILED:\n-\t\tcase PURCHASES_SITE_FETCH_FAILED:\n-\t\tcase PURCHASES_USER_FETCH_FAILED:\n-\t\t\treturn { ...state, error: action.error };\n-\n-\t\tcase PRIVACY_PROTECTION_CANCEL_COMPLETED:\n-\t\t\treturn updatePurchaseById( state, action.purchase.id, action.purchase );\n-\n-\t\tcase PRIVACY_PROTECTION_CANCEL_FAILED:\n-\t\t\treturn updatePurchaseById( state, action.purchaseId, {\n-\t\t\t\terror: action.error\n-\t\t\t} );\n-\n-\t\tdefault:\n-\t\t\treturn state;\n-\t}\n-};\n+const assignError = ( state, action ) => ( { ...state, error: action.error } );","path":"client/state/purchases/reducer.js","position":74,"original_position":74,"commit_id":"cb53a637d51b5f211eddd370426ae424a7a33149","original_commit_id":"cb53a637d51b5f211eddd370426ae424a7a33149","user":{"login":"gziolo","id":699132,"avatar_url":"https://avatars.githubusercontent.com/u/699132?v=3","gravatar_id":"","url":"https://api.github.com/users/gziolo","html_url":"https://github.com/gziolo","followers_url":"https://api.github.com/users/gziolo/followers","following_url":"https://api.github.com/users/gziolo/following{/other_user}","gists_url":"https://api.github.com/users/gziolo/gists{/gist_id}","starred_url":"https://api.github.com/users/gziolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gziolo/subscriptions","organizations_url":"https://api.github.com/users/gziolo/orgs","repos_url":"https://api.github.com/users/gziolo/repos","events_url":"https://api.github.com/users/gziolo/events{/privacy}","received_events_url":"https://api.github.com/users/gziolo/received_events","type":"User","site_admin":false},"body":"Oh, yes. We haven't figure out better approach yet :D","created_at":"2016-06-30T07:25:27Z","updated_at":"2016-06-30T07:25:27Z","html_url":"https://github.com/Automattic/wp-calypso/pull/6430#discussion_r69083392","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6430","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/69083392"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/6430#discussion_r69083392"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6430"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6430","id":75702564,"html_url":"https://github.com/Automattic/wp-calypso/pull/6430","diff_url":"https://github.com/Automattic/wp-calypso/pull/6430.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/6430.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6430","number":6430,"state":"open","locked":false,"title":"Purchases: Use `createReducer` in `state/purchases/reducer`","user":{"login":"drewblaisdell","id":1130674,"avatar_url":"https://avatars.githubusercontent.com/u/1130674?v=3","gravatar_id":"","url":"https://api.github.com/users/drewblaisdell","html_url":"https://github.com/drewblaisdell","followers_url":"https://api.github.com/users/drewblaisdell/followers","following_url":"https://api.github.com/users/drewblaisdell/following{/other_user}","gists_url":"https://api.github.com/users/drewblaisdell/gists{/gist_id}","starred_url":"https://api.github.com/users/drewblaisdell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewblaisdell/subscriptions","organizations_url":"https://api.github.com/users/drewblaisdell/orgs","repos_url":"https://api.github.com/users/drewblaisdell/repos","events_url":"https://api.github.com/users/drewblaisdell/events{/privacy}","received_events_url":"https://api.github.com/users/drewblaisdell/received_events","type":"User","site_admin":false},"body":"This gives us DE/SERIALIZE actions as well as a nicer looking reducer.\r\n\r\nThis just needs a code review, as this reducer is already tested (`state/purchases/test/reducer`) and isn't used in production yet.\r\n\r\ncc @gziolo who reminded me that we need these actions. :)\n\nTest live: https://calypso.live/?branch=update/purchases-reducer-create-reducer","created_at":"2016-06-29T18:59:49Z","updated_at":"2016-06-30T07:25:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cea1322b499bbaa3d97da4761895c4efbb8c678b","assignee":{"login":"drewblaisdell","id":1130674,"avatar_url":"https://avatars.githubusercontent.com/u/1130674?v=3","gravatar_id":"","url":"https://api.github.com/users/drewblaisdell","html_url":"https://github.com/drewblaisdell","followers_url":"https://api.github.com/users/drewblaisdell/followers","following_url":"https://api.github.com/users/drewblaisdell/following{/other_user}","gists_url":"https://api.github.com/users/drewblaisdell/gists{/gist_id}","starred_url":"https://api.github.com/users/drewblaisdell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewblaisdell/subscriptions","organizations_url":"https://api.github.com/users/drewblaisdell/orgs","repos_url":"https://api.github.com/users/drewblaisdell/repos","events_url":"https://api.github.com/users/drewblaisdell/events{/privacy}","received_events_url":"https://api.github.com/users/drewblaisdell/received_events","type":"User","site_admin":false},"assignees":[{"login":"drewblaisdell","id":1130674,"avatar_url":"https://avatars.githubusercontent.com/u/1130674?v=3","gravatar_id":"","url":"https://api.github.com/users/drewblaisdell","html_url":"https://github.com/drewblaisdell","followers_url":"https://api.github.com/users/drewblaisdell/followers","following_url":"https://api.github.com/users/drewblaisdell/following{/other_user}","gists_url":"https://api.github.com/users/drewblaisdell/gists{/gist_id}","starred_url":"https://api.github.com/users/drewblaisdell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewblaisdell/subscriptions","organizations_url":"https://api.github.com/users/drewblaisdell/orgs","repos_url":"https://api.github.com/users/drewblaisdell/repos","events_url":"https://api.github.com/users/drewblaisdell/events{/privacy}","received_events_url":"https://api.github.com/users/drewblaisdell/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6430/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6430/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/6430/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/cb53a637d51b5f211eddd370426ae424a7a33149","head":{"label":"Automattic:update/purchases-reducer-create-reducer","ref":"update/purchases-reducer-create-reducer","sha":"cb53a637d51b5f211eddd370426ae424a7a33149","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-06-30T05:03:44Z","pushed_at":"2016-06-30T06:17:19Z","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":80252,"stargazers_count":7520,"watchers_count":7520,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":931,"mirror_url":null,"open_issues_count":1326,"forks":931,"open_issues":1326,"watchers":7520,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"7cfa665698e2dc6ea26018a17cbece5f1751a05f","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-06-30T05:03:44Z","pushed_at":"2016-06-30T06:17:19Z","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":80252,"stargazers_count":7520,"watchers_count":7520,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":931,"mirror_url":null,"open_issues_count":1326,"forks":931,"open_issues":1326,"watchers":7520,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6430"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/6430"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/6430"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/6430/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6430/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/6430/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/cb53a637d51b5f211eddd370426ae424a7a33149"}}}}
{"actor":{"display_login":"gziolo"}}