{"action":"created","comment":{"url":"https://api.github.com/repos/acdlite/redux-actions/pulls/comments/80658772","pull_request_review_id":1700449,"id":80658772,"diff_hunk":"@@ -0,0 +1,9 @@\n+import isUndefined from 'lodash/isUndefined';\n+\n+export default function assertDefaultState(defaultState, actionTypes) {\n+  if (isUndefined(defaultState)) {\n+    throw new Error(\n+      `Expected defaultState for reducer handling ${actionTypes.join(', ')} to be defined`\n+    );\n+  }\n+}","path":"src/assertDefaultState.js","position":9,"original_position":9,"commit_id":"e7052449dfccc6d867e5b66b87c50f5ded7e57dc","original_commit_id":"e7052449dfccc6d867e5b66b87c50f5ded7e57dc","user":{"login":"timche","id":8075074,"avatar_url":"https://avatars.githubusercontent.com/u/8075074?v=3","gravatar_id":"","url":"https://api.github.com/users/timche","html_url":"https://github.com/timche","followers_url":"https://api.github.com/users/timche/followers","following_url":"https://api.github.com/users/timche/following{/other_user}","gists_url":"https://api.github.com/users/timche/gists{/gist_id}","starred_url":"https://api.github.com/users/timche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timche/subscriptions","organizations_url":"https://api.github.com/users/timche/orgs","repos_url":"https://api.github.com/users/timche/repos","events_url":"https://api.github.com/users/timche/events{/privacy}","received_events_url":"https://api.github.com/users/timche/received_events","type":"User","site_admin":false},"body":"I'd suggest to move this function to a folder named `utils` and name that file `assertions.js` or sth like this, where we can write more functions like this in a single file.","created_at":"2016-09-27T10:02:54Z","updated_at":"2016-09-27T10:02:54Z","html_url":"https://github.com/acdlite/redux-actions/pull/127#discussion_r80658772","pull_request_url":"https://api.github.com/repos/acdlite/redux-actions/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/comments/80658772"},"html":{"href":"https://github.com/acdlite/redux-actions/pull/127#discussion_r80658772"},"pull_request":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/acdlite/redux-actions/pulls/127","id":84044980,"html_url":"https://github.com/acdlite/redux-actions/pull/127","diff_url":"https://github.com/acdlite/redux-actions/pull/127.diff","patch_url":"https://github.com/acdlite/redux-actions/pull/127.patch","issue_url":"https://api.github.com/repos/acdlite/redux-actions/issues/127","number":127,"state":"open","locked":false,"title":"Make defaultState required when creating reducers","user":{"login":"yangmillstheory","id":2729079,"avatar_url":"https://avatars.githubusercontent.com/u/2729079?v=3","gravatar_id":"","url":"https://api.github.com/users/yangmillstheory","html_url":"https://github.com/yangmillstheory","followers_url":"https://api.github.com/users/yangmillstheory/followers","following_url":"https://api.github.com/users/yangmillstheory/following{/other_user}","gists_url":"https://api.github.com/users/yangmillstheory/gists{/gist_id}","starred_url":"https://api.github.com/users/yangmillstheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yangmillstheory/subscriptions","organizations_url":"https://api.github.com/users/yangmillstheory/orgs","repos_url":"https://api.github.com/users/yangmillstheory/repos","events_url":"https://api.github.com/users/yangmillstheory/events{/privacy}","received_events_url":"https://api.github.com/users/yangmillstheory/received_events","type":"User","site_admin":false},"body":"Close #18.\r\n\r\nSee that issue and also https://github.com/reactjs/redux/issues/514 for background and discussion. \r\n***\r\n**TL;DR**\r\n\r\nWe can prevent downstream reducer sanity errors [like this one](https://github.com/reactjs/redux/blob/master/src/combineReducers.js#L63) by throwing earlier.\r\n***\r\nSince this throws an (already thrown) upstream error earlier, I'm not sure if this qualifies as a breaking change.","created_at":"2016-09-05T23:32:40Z","updated_at":"2016-09-27T10:03:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"798433911e513c32825dc3488580e8be3c8f100d","assignee":{"login":"timche","id":8075074,"avatar_url":"https://avatars.githubusercontent.com/u/8075074?v=3","gravatar_id":"","url":"https://api.github.com/users/timche","html_url":"https://github.com/timche","followers_url":"https://api.github.com/users/timche/followers","following_url":"https://api.github.com/users/timche/following{/other_user}","gists_url":"https://api.github.com/users/timche/gists{/gist_id}","starred_url":"https://api.github.com/users/timche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timche/subscriptions","organizations_url":"https://api.github.com/users/timche/orgs","repos_url":"https://api.github.com/users/timche/repos","events_url":"https://api.github.com/users/timche/events{/privacy}","received_events_url":"https://api.github.com/users/timche/received_events","type":"User","site_admin":false},"assignees":[{"login":"timche","id":8075074,"avatar_url":"https://avatars.githubusercontent.com/u/8075074?v=3","gravatar_id":"","url":"https://api.github.com/users/timche","html_url":"https://github.com/timche","followers_url":"https://api.github.com/users/timche/followers","following_url":"https://api.github.com/users/timche/following{/other_user}","gists_url":"https://api.github.com/users/timche/gists{/gist_id}","starred_url":"https://api.github.com/users/timche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timche/subscriptions","organizations_url":"https://api.github.com/users/timche/orgs","repos_url":"https://api.github.com/users/timche/repos","events_url":"https://api.github.com/users/timche/events{/privacy}","received_events_url":"https://api.github.com/users/timche/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/acdlite/redux-actions/pulls/127/commits","review_comments_url":"https://api.github.com/repos/acdlite/redux-actions/pulls/127/comments","review_comment_url":"https://api.github.com/repos/acdlite/redux-actions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acdlite/redux-actions/issues/127/comments","statuses_url":"https://api.github.com/repos/acdlite/redux-actions/statuses/e7052449dfccc6d867e5b66b87c50f5ded7e57dc","head":{"label":"acdlite:feat/default-state","ref":"feat/default-state","sha":"e7052449dfccc6d867e5b66b87c50f5ded7e57dc","user":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars.githubusercontent.com/u/3624098?v=3","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"repo":{"id":38395154,"name":"redux-actions","full_name":"acdlite/redux-actions","owner":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars.githubusercontent.com/u/3624098?v=3","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acdlite/redux-actions","description":"Flux Standard Action utilities for Redux.","fork":false,"url":"https://api.github.com/repos/acdlite/redux-actions","forks_url":"https://api.github.com/repos/acdlite/redux-actions/forks","keys_url":"https://api.github.com/repos/acdlite/redux-actions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acdlite/redux-actions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acdlite/redux-actions/teams","hooks_url":"https://api.github.com/repos/acdlite/redux-actions/hooks","issue_events_url":"https://api.github.com/repos/acdlite/redux-actions/issues/events{/number}","events_url":"https://api.github.com/repos/acdlite/redux-actions/events","assignees_url":"https://api.github.com/repos/acdlite/redux-actions/assignees{/user}","branches_url":"https://api.github.com/repos/acdlite/redux-actions/branches{/branch}","tags_url":"https://api.github.com/repos/acdlite/redux-actions/tags","blobs_url":"https://api.github.com/repos/acdlite/redux-actions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acdlite/redux-actions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acdlite/redux-actions/git/refs{/sha}","trees_url":"https://api.github.com/repos/acdlite/redux-actions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acdlite/redux-actions/statuses/{sha}","languages_url":"https://api.github.com/repos/acdlite/redux-actions/languages","stargazers_url":"https://api.github.com/repos/acdlite/redux-actions/stargazers","contributors_url":"https://api.github.com/repos/acdlite/redux-actions/contributors","subscribers_url":"https://api.github.com/repos/acdlite/redux-actions/subscribers","subscription_url":"https://api.github.com/repos/acdlite/redux-actions/subscription","commits_url":"https://api.github.com/repos/acdlite/redux-actions/commits{/sha}","git_commits_url":"https://api.github.com/repos/acdlite/redux-actions/git/commits{/sha}","comments_url":"https://api.github.com/repos/acdlite/redux-actions/comments{/number}","issue_comment_url":"https://api.github.com/repos/acdlite/redux-actions/issues/comments{/number}","contents_url":"https://api.github.com/repos/acdlite/redux-actions/contents/{+path}","compare_url":"https://api.github.com/repos/acdlite/redux-actions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acdlite/redux-actions/merges","archive_url":"https://api.github.com/repos/acdlite/redux-actions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acdlite/redux-actions/downloads","issues_url":"https://api.github.com/repos/acdlite/redux-actions/issues{/number}","pulls_url":"https://api.github.com/repos/acdlite/redux-actions/pulls{/number}","milestones_url":"https://api.github.com/repos/acdlite/redux-actions/milestones{/number}","notifications_url":"https://api.github.com/repos/acdlite/redux-actions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acdlite/redux-actions/labels{/name}","releases_url":"https://api.github.com/repos/acdlite/redux-actions/releases{/id}","deployments_url":"https://api.github.com/repos/acdlite/redux-actions/deployments","created_at":"2015-07-01T21:08:45Z","updated_at":"2016-09-27T09:12:58Z","pushed_at":"2016-09-27T09:57:19Z","git_url":"git://github.com/acdlite/redux-actions.git","ssh_url":"git@github.com:acdlite/redux-actions.git","clone_url":"https://github.com/acdlite/redux-actions.git","svn_url":"https://github.com/acdlite/redux-actions","homepage":"","size":212,"stargazers_count":1963,"watchers_count":1963,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":88,"mirror_url":null,"open_issues_count":20,"forks":88,"open_issues":20,"watchers":1963,"default_branch":"master"}},"base":{"label":"acdlite:v1.0.0","ref":"v1.0.0","sha":"1e818aba0befaddfa8d572d853dd45a99cbe8187","user":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars.githubusercontent.com/u/3624098?v=3","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"repo":{"id":38395154,"name":"redux-actions","full_name":"acdlite/redux-actions","owner":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars.githubusercontent.com/u/3624098?v=3","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acdlite/redux-actions","description":"Flux Standard Action utilities for Redux.","fork":false,"url":"https://api.github.com/repos/acdlite/redux-actions","forks_url":"https://api.github.com/repos/acdlite/redux-actions/forks","keys_url":"https://api.github.com/repos/acdlite/redux-actions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acdlite/redux-actions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acdlite/redux-actions/teams","hooks_url":"https://api.github.com/repos/acdlite/redux-actions/hooks","issue_events_url":"https://api.github.com/repos/acdlite/redux-actions/issues/events{/number}","events_url":"https://api.github.com/repos/acdlite/redux-actions/events","assignees_url":"https://api.github.com/repos/acdlite/redux-actions/assignees{/user}","branches_url":"https://api.github.com/repos/acdlite/redux-actions/branches{/branch}","tags_url":"https://api.github.com/repos/acdlite/redux-actions/tags","blobs_url":"https://api.github.com/repos/acdlite/redux-actions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acdlite/redux-actions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acdlite/redux-actions/git/refs{/sha}","trees_url":"https://api.github.com/repos/acdlite/redux-actions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acdlite/redux-actions/statuses/{sha}","languages_url":"https://api.github.com/repos/acdlite/redux-actions/languages","stargazers_url":"https://api.github.com/repos/acdlite/redux-actions/stargazers","contributors_url":"https://api.github.com/repos/acdlite/redux-actions/contributors","subscribers_url":"https://api.github.com/repos/acdlite/redux-actions/subscribers","subscription_url":"https://api.github.com/repos/acdlite/redux-actions/subscription","commits_url":"https://api.github.com/repos/acdlite/redux-actions/commits{/sha}","git_commits_url":"https://api.github.com/repos/acdlite/redux-actions/git/commits{/sha}","comments_url":"https://api.github.com/repos/acdlite/redux-actions/comments{/number}","issue_comment_url":"https://api.github.com/repos/acdlite/redux-actions/issues/comments{/number}","contents_url":"https://api.github.com/repos/acdlite/redux-actions/contents/{+path}","compare_url":"https://api.github.com/repos/acdlite/redux-actions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acdlite/redux-actions/merges","archive_url":"https://api.github.com/repos/acdlite/redux-actions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acdlite/redux-actions/downloads","issues_url":"https://api.github.com/repos/acdlite/redux-actions/issues{/number}","pulls_url":"https://api.github.com/repos/acdlite/redux-actions/pulls{/number}","milestones_url":"https://api.github.com/repos/acdlite/redux-actions/milestones{/number}","notifications_url":"https://api.github.com/repos/acdlite/redux-actions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acdlite/redux-actions/labels{/name}","releases_url":"https://api.github.com/repos/acdlite/redux-actions/releases{/id}","deployments_url":"https://api.github.com/repos/acdlite/redux-actions/deployments","created_at":"2015-07-01T21:08:45Z","updated_at":"2016-09-27T09:12:58Z","pushed_at":"2016-09-27T09:57:19Z","git_url":"git://github.com/acdlite/redux-actions.git","ssh_url":"git@github.com:acdlite/redux-actions.git","clone_url":"https://github.com/acdlite/redux-actions.git","svn_url":"https://github.com/acdlite/redux-actions","homepage":"","size":212,"stargazers_count":1963,"watchers_count":1963,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":88,"mirror_url":null,"open_issues_count":20,"forks":88,"open_issues":20,"watchers":1963,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/127"},"html":{"href":"https://github.com/acdlite/redux-actions/pull/127"},"issue":{"href":"https://api.github.com/repos/acdlite/redux-actions/issues/127"},"comments":{"href":"https://api.github.com/repos/acdlite/redux-actions/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/acdlite/redux-actions/statuses/e7052449dfccc6d867e5b66b87c50f5ded7e57dc"}}}}
{"actor":{"display_login":"timche"}}