{"action":"created","comment":{"url":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/comments/218456417","pull_request_review_id":156387791,"id":218456417,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODQ1NjQxNw==","diff_hunk":"@@ -0,0 +1,111 @@\n+import { RSAA } from 'redux-api-middleware';\n+\n+import * as types from './types';\n+\n+const HEADERS_BASE = {\n+  Accept: 'application/json',\n+  'Content-Type': 'application/json',\n+};\n+\n+const API_URL_BASE = 'http://localhost:8000/';\n+\n+/*\n+* Redux API Middleware (https://github.com/agraboso/redux-api-middleware)\n+* will intercept any action that contains the RSAA key, and instead dispatch\n+* some of the actions defined in the types property below, based on how\n+* the request resolves. It uses the new JavaScript Fetch API internally.\n+*/\n+\n+export const fetchUsers = () => {\n+  return {\n+    [RSAA]: {\n+      endpoint: API_URL_BASE + 'users',\n+      method: 'GET',\n+      types: [\n+        types.USERS_FETCH_REQUEST,\n+        types.USERS_FETCH_SUCCESS,\n+        types.USERS_FETCH_FAILURE,\n+      ],\n+      headers: HEADERS_BASE,\n+    },\n+  };\n+};\n+\n+/*\n+* This is more or less functionally equivalent with the commented out\n+* redux-api-middleware fetchBooks action defined below. There are many\n+* different ways to handle async actions in redux. redux-api-middleware is\n+* a nice abstraction (IMO ;) for AJAX requests, because they always have","path":"src/actions/api.js","position":38,"original_position":38,"commit_id":"d7aef996f2f425c34c8fcbb07cdac6f74bcc5ff9","original_commit_id":"d7aef996f2f425c34c8fcbb07cdac6f74bcc5ff9","user":{"login":"boweihan","id":10264198,"node_id":"MDQ6VXNlcjEwMjY0MTk4","avatar_url":"https://avatars3.githubusercontent.com/u/10264198?v=4","gravatar_id":"","url":"https://api.github.com/users/boweihan","html_url":"https://github.com/boweihan","followers_url":"https://api.github.com/users/boweihan/followers","following_url":"https://api.github.com/users/boweihan/following{/other_user}","gists_url":"https://api.github.com/users/boweihan/gists{/gist_id}","starred_url":"https://api.github.com/users/boweihan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boweihan/subscriptions","organizations_url":"https://api.github.com/users/boweihan/orgs","repos_url":"https://api.github.com/users/boweihan/repos","events_url":"https://api.github.com/users/boweihan/events{/privacy}","received_events_url":"https://api.github.com/users/boweihan/received_events","type":"User","site_admin":false},"body":"Hah jeez. it IS a nice abstraction but just like any tool it isn't always the right choice ;)","created_at":"2018-09-18T14:29:24Z","updated_at":"2018-09-18T14:29:47Z","html_url":"https://github.com/boweihan/react-redux-workshop/pull/1#discussion_r218456417","pull_request_url":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/comments/218456417"},"html":{"href":"https://github.com/boweihan/react-redux-workshop/pull/1#discussion_r218456417"},"pull_request":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1","id":216312617,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MzEyNjE3","html_url":"https://github.com/boweihan/react-redux-workshop/pull/1","diff_url":"https://github.com/boweihan/react-redux-workshop/pull/1.diff","patch_url":"https://github.com/boweihan/react-redux-workshop/pull/1.patch","issue_url":"https://api.github.com/repos/boweihan/react-redux-workshop/issues/1","number":1,"state":"open","locked":false,"title":"Add fake server and update entities","user":{"login":"pilifs","id":3997407,"node_id":"MDQ6VXNlcjM5OTc0MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/3997407?v=4","gravatar_id":"","url":"https://api.github.com/users/pilifs","html_url":"https://github.com/pilifs","followers_url":"https://api.github.com/users/pilifs/followers","following_url":"https://api.github.com/users/pilifs/following{/other_user}","gists_url":"https://api.github.com/users/pilifs/gists{/gist_id}","starred_url":"https://api.github.com/users/pilifs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pilifs/subscriptions","organizations_url":"https://api.github.com/users/pilifs/orgs","repos_url":"https://api.github.com/users/pilifs/repos","events_url":"https://api.github.com/users/pilifs/events{/privacy}","received_events_url":"https://api.github.com/users/pilifs/received_events","type":"User","site_admin":false},"body":":)","created_at":"2018-09-18T13:42:44Z","updated_at":"2018-09-18T14:29:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"135a42a59e19019a035df10f240c07e161725302","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1/commits","review_comments_url":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1/comments","review_comment_url":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boweihan/react-redux-workshop/issues/1/comments","statuses_url":"https://api.github.com/repos/boweihan/react-redux-workshop/statuses/d7aef996f2f425c34c8fcbb07cdac6f74bcc5ff9","head":{"label":"pilifs:add-server","ref":"add-server","sha":"d7aef996f2f425c34c8fcbb07cdac6f74bcc5ff9","user":{"login":"pilifs","id":3997407,"node_id":"MDQ6VXNlcjM5OTc0MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/3997407?v=4","gravatar_id":"","url":"https://api.github.com/users/pilifs","html_url":"https://github.com/pilifs","followers_url":"https://api.github.com/users/pilifs/followers","following_url":"https://api.github.com/users/pilifs/following{/other_user}","gists_url":"https://api.github.com/users/pilifs/gists{/gist_id}","starred_url":"https://api.github.com/users/pilifs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pilifs/subscriptions","organizations_url":"https://api.github.com/users/pilifs/orgs","repos_url":"https://api.github.com/users/pilifs/repos","events_url":"https://api.github.com/users/pilifs/events{/privacy}","received_events_url":"https://api.github.com/users/pilifs/received_events","type":"User","site_admin":false},"repo":{"id":149167800,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkxNjc4MDA=","name":"react-redux-workshop","full_name":"pilifs/react-redux-workshop","private":false,"owner":{"login":"pilifs","id":3997407,"node_id":"MDQ6VXNlcjM5OTc0MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/3997407?v=4","gravatar_id":"","url":"https://api.github.com/users/pilifs","html_url":"https://github.com/pilifs","followers_url":"https://api.github.com/users/pilifs/followers","following_url":"https://api.github.com/users/pilifs/following{/other_user}","gists_url":"https://api.github.com/users/pilifs/gists{/gist_id}","starred_url":"https://api.github.com/users/pilifs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pilifs/subscriptions","organizations_url":"https://api.github.com/users/pilifs/orgs","repos_url":"https://api.github.com/users/pilifs/repos","events_url":"https://api.github.com/users/pilifs/events{/privacy}","received_events_url":"https://api.github.com/users/pilifs/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pilifs/react-redux-workshop","description":null,"fork":true,"url":"https://api.github.com/repos/pilifs/react-redux-workshop","forks_url":"https://api.github.com/repos/pilifs/react-redux-workshop/forks","keys_url":"https://api.github.com/repos/pilifs/react-redux-workshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pilifs/react-redux-workshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pilifs/react-redux-workshop/teams","hooks_url":"https://api.github.com/repos/pilifs/react-redux-workshop/hooks","issue_events_url":"https://api.github.com/repos/pilifs/react-redux-workshop/issues/events{/number}","events_url":"https://api.github.com/repos/pilifs/react-redux-workshop/events","assignees_url":"https://api.github.com/repos/pilifs/react-redux-workshop/assignees{/user}","branches_url":"https://api.github.com/repos/pilifs/react-redux-workshop/branches{/branch}","tags_url":"https://api.github.com/repos/pilifs/react-redux-workshop/tags","blobs_url":"https://api.github.com/repos/pilifs/react-redux-workshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pilifs/react-redux-workshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pilifs/react-redux-workshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/pilifs/react-redux-workshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pilifs/react-redux-workshop/statuses/{sha}","languages_url":"https://api.github.com/repos/pilifs/react-redux-workshop/languages","stargazers_url":"https://api.github.com/repos/pilifs/react-redux-workshop/stargazers","contributors_url":"https://api.github.com/repos/pilifs/react-redux-workshop/contributors","subscribers_url":"https://api.github.com/repos/pilifs/react-redux-workshop/subscribers","subscription_url":"https://api.github.com/repos/pilifs/react-redux-workshop/subscription","commits_url":"https://api.github.com/repos/pilifs/react-redux-workshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/pilifs/react-redux-workshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/pilifs/react-redux-workshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/pilifs/react-redux-workshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/pilifs/react-redux-workshop/contents/{+path}","compare_url":"https://api.github.com/repos/pilifs/react-redux-workshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pilifs/react-redux-workshop/merges","archive_url":"https://api.github.com/repos/pilifs/react-redux-workshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pilifs/react-redux-workshop/downloads","issues_url":"https://api.github.com/repos/pilifs/react-redux-workshop/issues{/number}","pulls_url":"https://api.github.com/repos/pilifs/react-redux-workshop/pulls{/number}","milestones_url":"https://api.github.com/repos/pilifs/react-redux-workshop/milestones{/number}","notifications_url":"https://api.github.com/repos/pilifs/react-redux-workshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pilifs/react-redux-workshop/labels{/name}","releases_url":"https://api.github.com/repos/pilifs/react-redux-workshop/releases{/id}","deployments_url":"https://api.github.com/repos/pilifs/react-redux-workshop/deployments","created_at":"2018-09-17T18:10:28Z","updated_at":"2018-09-17T18:10:31Z","pushed_at":"2018-09-18T13:54:19Z","git_url":"git://github.com/pilifs/react-redux-workshop.git","ssh_url":"git@github.com:pilifs/react-redux-workshop.git","clone_url":"https://github.com/pilifs/react-redux-workshop.git","svn_url":"https://github.com/pilifs/react-redux-workshop","homepage":null,"size":679,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"boweihan:master","ref":"master","sha":"3e491260dbdab5ac4ddf7013d6e901144ce29a38","user":{"login":"boweihan","id":10264198,"node_id":"MDQ6VXNlcjEwMjY0MTk4","avatar_url":"https://avatars3.githubusercontent.com/u/10264198?v=4","gravatar_id":"","url":"https://api.github.com/users/boweihan","html_url":"https://github.com/boweihan","followers_url":"https://api.github.com/users/boweihan/followers","following_url":"https://api.github.com/users/boweihan/following{/other_user}","gists_url":"https://api.github.com/users/boweihan/gists{/gist_id}","starred_url":"https://api.github.com/users/boweihan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boweihan/subscriptions","organizations_url":"https://api.github.com/users/boweihan/orgs","repos_url":"https://api.github.com/users/boweihan/repos","events_url":"https://api.github.com/users/boweihan/events{/privacy}","received_events_url":"https://api.github.com/users/boweihan/received_events","type":"User","site_admin":false},"repo":{"id":148850574,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg4NTA1NzQ=","name":"react-redux-workshop","full_name":"boweihan/react-redux-workshop","private":false,"owner":{"login":"boweihan","id":10264198,"node_id":"MDQ6VXNlcjEwMjY0MTk4","avatar_url":"https://avatars3.githubusercontent.com/u/10264198?v=4","gravatar_id":"","url":"https://api.github.com/users/boweihan","html_url":"https://github.com/boweihan","followers_url":"https://api.github.com/users/boweihan/followers","following_url":"https://api.github.com/users/boweihan/following{/other_user}","gists_url":"https://api.github.com/users/boweihan/gists{/gist_id}","starred_url":"https://api.github.com/users/boweihan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boweihan/subscriptions","organizations_url":"https://api.github.com/users/boweihan/orgs","repos_url":"https://api.github.com/users/boweihan/repos","events_url":"https://api.github.com/users/boweihan/events{/privacy}","received_events_url":"https://api.github.com/users/boweihan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/boweihan/react-redux-workshop","description":null,"fork":false,"url":"https://api.github.com/repos/boweihan/react-redux-workshop","forks_url":"https://api.github.com/repos/boweihan/react-redux-workshop/forks","keys_url":"https://api.github.com/repos/boweihan/react-redux-workshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boweihan/react-redux-workshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boweihan/react-redux-workshop/teams","hooks_url":"https://api.github.com/repos/boweihan/react-redux-workshop/hooks","issue_events_url":"https://api.github.com/repos/boweihan/react-redux-workshop/issues/events{/number}","events_url":"https://api.github.com/repos/boweihan/react-redux-workshop/events","assignees_url":"https://api.github.com/repos/boweihan/react-redux-workshop/assignees{/user}","branches_url":"https://api.github.com/repos/boweihan/react-redux-workshop/branches{/branch}","tags_url":"https://api.github.com/repos/boweihan/react-redux-workshop/tags","blobs_url":"https://api.github.com/repos/boweihan/react-redux-workshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boweihan/react-redux-workshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boweihan/react-redux-workshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/boweihan/react-redux-workshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boweihan/react-redux-workshop/statuses/{sha}","languages_url":"https://api.github.com/repos/boweihan/react-redux-workshop/languages","stargazers_url":"https://api.github.com/repos/boweihan/react-redux-workshop/stargazers","contributors_url":"https://api.github.com/repos/boweihan/react-redux-workshop/contributors","subscribers_url":"https://api.github.com/repos/boweihan/react-redux-workshop/subscribers","subscription_url":"https://api.github.com/repos/boweihan/react-redux-workshop/subscription","commits_url":"https://api.github.com/repos/boweihan/react-redux-workshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/boweihan/react-redux-workshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/boweihan/react-redux-workshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/boweihan/react-redux-workshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/boweihan/react-redux-workshop/contents/{+path}","compare_url":"https://api.github.com/repos/boweihan/react-redux-workshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boweihan/react-redux-workshop/merges","archive_url":"https://api.github.com/repos/boweihan/react-redux-workshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boweihan/react-redux-workshop/downloads","issues_url":"https://api.github.com/repos/boweihan/react-redux-workshop/issues{/number}","pulls_url":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls{/number}","milestones_url":"https://api.github.com/repos/boweihan/react-redux-workshop/milestones{/number}","notifications_url":"https://api.github.com/repos/boweihan/react-redux-workshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boweihan/react-redux-workshop/labels{/name}","releases_url":"https://api.github.com/repos/boweihan/react-redux-workshop/releases{/id}","deployments_url":"https://api.github.com/repos/boweihan/react-redux-workshop/deployments","created_at":"2018-09-14T23:14:51Z","updated_at":"2018-09-16T22:27:20Z","pushed_at":"2018-09-18T13:54:20Z","git_url":"git://github.com/boweihan/react-redux-workshop.git","ssh_url":"git@github.com:boweihan/react-redux-workshop.git","clone_url":"https://github.com/boweihan/react-redux-workshop.git","svn_url":"https://github.com/boweihan/react-redux-workshop","homepage":null,"size":679,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1"},"html":{"href":"https://github.com/boweihan/react-redux-workshop/pull/1"},"issue":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/issues/1"},"comments":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/boweihan/react-redux-workshop/statuses/d7aef996f2f425c34c8fcbb07cdac6f74bcc5ff9"}},"author_association":"NONE"}}
{"actor":{"display_login":"boweihan"}}