{"action":"created","comment":{"url":"https://api.github.com/repos/acdlite/redux-actions/pulls/comments/48900021","id":48900021,"diff_hunk":"@@ -5,9 +5,13 @@ function isFunction(val) {\n }\n \n export default function handleAction(type, reducers) {\n+  const typeValue = isFunction(type)","path":"src/handleAction.js","position":4,"original_position":4,"commit_id":"8e8e6981e7159270e7c4341729b543a951fbc145","original_commit_id":"8e8e6981e7159270e7c4341729b543a951fbc145","user":{"login":"nikita-graf","id":2078870,"avatar_url":"https://avatars.githubusercontent.com/u/2078870?v=3","gravatar_id":"","url":"https://api.github.com/users/nikita-graf","html_url":"https://github.com/nikita-graf","followers_url":"https://api.github.com/users/nikita-graf/followers","following_url":"https://api.github.com/users/nikita-graf/following{/other_user}","gists_url":"https://api.github.com/users/nikita-graf/gists{/gist_id}","starred_url":"https://api.github.com/users/nikita-graf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikita-graf/subscriptions","organizations_url":"https://api.github.com/users/nikita-graf/orgs","repos_url":"https://api.github.com/users/nikita-graf/repos","events_url":"https://api.github.com/users/nikita-graf/events{/privacy}","received_events_url":"https://api.github.com/users/nikita-graf/received_events","type":"User","site_admin":false},"body":"Do you mean `const typeValue = String(type)` instead of `const typeValue = isFunction(type) ? type.toString() : type` ?","created_at":"2016-01-05T21:42:22Z","updated_at":"2016-01-05T21:42:22Z","html_url":"https://github.com/acdlite/redux-actions/pull/51#discussion_r48900021","pull_request_url":"https://api.github.com/repos/acdlite/redux-actions/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/comments/48900021"},"html":{"href":"https://github.com/acdlite/redux-actions/pull/51#discussion_r48900021"},"pull_request":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/acdlite/redux-actions/pulls/51","id":54602720,"html_url":"https://github.com/acdlite/redux-actions/pull/51","diff_url":"https://github.com/acdlite/redux-actions/pull/51.diff","patch_url":"https://github.com/acdlite/redux-actions/pull/51.patch","issue_url":"https://api.github.com/repos/acdlite/redux-actions/issues/51","number":51,"state":"open","locked":false,"title":"Use action function as handleAction(s) type param","user":{"login":"nikita-graf","id":2078870,"avatar_url":"https://avatars.githubusercontent.com/u/2078870?v=3","gravatar_id":"","url":"https://api.github.com/users/nikita-graf","html_url":"https://github.com/nikita-graf","followers_url":"https://api.github.com/users/nikita-graf/followers","following_url":"https://api.github.com/users/nikita-graf/following{/other_user}","gists_url":"https://api.github.com/users/nikita-graf/gists{/gist_id}","starred_url":"https://api.github.com/users/nikita-graf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikita-graf/subscriptions","organizations_url":"https://api.github.com/users/nikita-graf/orgs","repos_url":"https://api.github.com/users/nikita-graf/repos","events_url":"https://api.github.com/users/nikita-graf/events{/privacy}","received_events_url":"https://api.github.com/users/nikita-graf/received_events","type":"User","site_admin":false},"body":"This PR allows to use actions as type parameter for `handleAction` and `handleActions` like so:\r\n```javaScript\r\nlet increment = createAction('INCREMENT', amount => amount);\r\n\r\nconst reducer = handleActions({\r\n  [increment]: (state, action) => ({\r\n    counter: state.counter + action.payload\r\n  })\r\n}, { counter: 0 });\r\n\r\nhandleAction(increment , {\r\n  next(state, action) {...}\r\n  throw(state, action) {...}\r\n});\r\n```\r\nIt prevents from copy&paste action names across modules, allows to use autocomplete in IDE.","created_at":"2015-12-26T14:02:48Z","updated_at":"2016-01-05T21:42:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e60f87726a4588d6f2fc6de9c5f35b0815f642ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/acdlite/redux-actions/pulls/51/commits","review_comments_url":"https://api.github.com/repos/acdlite/redux-actions/pulls/51/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/51/comments","statuses_url":"https://api.github.com/repos/acdlite/redux-actions/statuses/8e8e6981e7159270e7c4341729b543a951fbc145","head":{"label":"nikita-graf:handle-function-action","ref":"handle-function-action","sha":"8e8e6981e7159270e7c4341729b543a951fbc145","user":{"login":"nikita-graf","id":2078870,"avatar_url":"https://avatars.githubusercontent.com/u/2078870?v=3","gravatar_id":"","url":"https://api.github.com/users/nikita-graf","html_url":"https://github.com/nikita-graf","followers_url":"https://api.github.com/users/nikita-graf/followers","following_url":"https://api.github.com/users/nikita-graf/following{/other_user}","gists_url":"https://api.github.com/users/nikita-graf/gists{/gist_id}","starred_url":"https://api.github.com/users/nikita-graf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikita-graf/subscriptions","organizations_url":"https://api.github.com/users/nikita-graf/orgs","repos_url":"https://api.github.com/users/nikita-graf/repos","events_url":"https://api.github.com/users/nikita-graf/events{/privacy}","received_events_url":"https://api.github.com/users/nikita-graf/received_events","type":"User","site_admin":false},"repo":{"id":48609375,"name":"redux-actions","full_name":"nikita-graf/redux-actions","owner":{"login":"nikita-graf","id":2078870,"avatar_url":"https://avatars.githubusercontent.com/u/2078870?v=3","gravatar_id":"","url":"https://api.github.com/users/nikita-graf","html_url":"https://github.com/nikita-graf","followers_url":"https://api.github.com/users/nikita-graf/followers","following_url":"https://api.github.com/users/nikita-graf/following{/other_user}","gists_url":"https://api.github.com/users/nikita-graf/gists{/gist_id}","starred_url":"https://api.github.com/users/nikita-graf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikita-graf/subscriptions","organizations_url":"https://api.github.com/users/nikita-graf/orgs","repos_url":"https://api.github.com/users/nikita-graf/repos","events_url":"https://api.github.com/users/nikita-graf/events{/privacy}","received_events_url":"https://api.github.com/users/nikita-graf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikita-graf/redux-actions","description":"Flux Standard Action utilities for Redux.","fork":true,"url":"https://api.github.com/repos/nikita-graf/redux-actions","forks_url":"https://api.github.com/repos/nikita-graf/redux-actions/forks","keys_url":"https://api.github.com/repos/nikita-graf/redux-actions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikita-graf/redux-actions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikita-graf/redux-actions/teams","hooks_url":"https://api.github.com/repos/nikita-graf/redux-actions/hooks","issue_events_url":"https://api.github.com/repos/nikita-graf/redux-actions/issues/events{/number}","events_url":"https://api.github.com/repos/nikita-graf/redux-actions/events","assignees_url":"https://api.github.com/repos/nikita-graf/redux-actions/assignees{/user}","branches_url":"https://api.github.com/repos/nikita-graf/redux-actions/branches{/branch}","tags_url":"https://api.github.com/repos/nikita-graf/redux-actions/tags","blobs_url":"https://api.github.com/repos/nikita-graf/redux-actions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikita-graf/redux-actions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikita-graf/redux-actions/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikita-graf/redux-actions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikita-graf/redux-actions/statuses/{sha}","languages_url":"https://api.github.com/repos/nikita-graf/redux-actions/languages","stargazers_url":"https://api.github.com/repos/nikita-graf/redux-actions/stargazers","contributors_url":"https://api.github.com/repos/nikita-graf/redux-actions/contributors","subscribers_url":"https://api.github.com/repos/nikita-graf/redux-actions/subscribers","subscription_url":"https://api.github.com/repos/nikita-graf/redux-actions/subscription","commits_url":"https://api.github.com/repos/nikita-graf/redux-actions/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikita-graf/redux-actions/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikita-graf/redux-actions/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikita-graf/redux-actions/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikita-graf/redux-actions/contents/{+path}","compare_url":"https://api.github.com/repos/nikita-graf/redux-actions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikita-graf/redux-actions/merges","archive_url":"https://api.github.com/repos/nikita-graf/redux-actions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikita-graf/redux-actions/downloads","issues_url":"https://api.github.com/repos/nikita-graf/redux-actions/issues{/number}","pulls_url":"https://api.github.com/repos/nikita-graf/redux-actions/pulls{/number}","milestones_url":"https://api.github.com/repos/nikita-graf/redux-actions/milestones{/number}","notifications_url":"https://api.github.com/repos/nikita-graf/redux-actions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikita-graf/redux-actions/labels{/name}","releases_url":"https://api.github.com/repos/nikita-graf/redux-actions/releases{/id}","created_at":"2015-12-26T12:06:35Z","updated_at":"2015-12-26T12:06:36Z","pushed_at":"2015-12-26T13:09:29Z","git_url":"git://github.com/nikita-graf/redux-actions.git","ssh_url":"git@github.com:nikita-graf/redux-actions.git","clone_url":"https://github.com/nikita-graf/redux-actions.git","svn_url":"https://github.com/nikita-graf/redux-actions","homepage":"","size":34,"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":"acdlite:master","ref":"master","sha":"afa68812198ae3fbd6a974d4a89fe2429cafded9","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}","created_at":"2015-07-01T21:08:45Z","updated_at":"2016-01-05T17:24:36Z","pushed_at":"2016-01-04T17:21:36Z","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":54,"stargazers_count":597,"watchers_count":597,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":26,"forks":27,"open_issues":26,"watchers":597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/51"},"html":{"href":"https://github.com/acdlite/redux-actions/pull/51"},"issue":{"href":"https://api.github.com/repos/acdlite/redux-actions/issues/51"},"comments":{"href":"https://api.github.com/repos/acdlite/redux-actions/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/acdlite/redux-actions/pulls/51/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/51/commits"},"statuses":{"href":"https://api.github.com/repos/acdlite/redux-actions/statuses/8e8e6981e7159270e7c4341729b543a951fbc145"}}}}