{"action":"created","comment":{"url":"https://api.github.com/repos/appnexus/lucid/pulls/comments/60801387","id":60801387,"diff_hunk":"@@ -0,0 +1,246 @@\n+import {\n+\tassign,\n+\tget,\n+\tidentity,\n+\tisArray,\n+\tisEmpty,\n+\tisFunction,\n+\tisUndefined,\n+\tmerge,\n+\treduce,\n+\tslice\n+} from 'lodash';\n+import { createSelector } from 'reselect';\n+\n+/**\n+ * thunk\n+ *\n+ * Marks a function on the reducer tree as a thunk action creator so it doesn't\n+ * get incorporated into the redux reducer\n+ *\n+ * @return {function} with `isThunk` set to `true`\n+ */\n+export function thunk(fn) {\n+\tfn.isThunk = true;\n+\treturn fn;\n+}\n+\n+/**\n+ * getReduxPrimitives\n+ *\n+ * Creates a redux reducer and connectors (inputs to redux-react's `connect`)\n+ *\n+ * @param {Object} param\n+ * @param {Object} param.initialState - the initial state object that the reducer will return\n+ * @param {Object} param.reducers - a tree of lucid reducers\n+ * @param {string[]} param.rootPath - array of strings representing the path to local state in global state\n+ * @param {Object} param.selectors - a tree of lucid selectors\n+ * @return {Object} redux reducer and connectors\n+ */\n+\n+export function getReduxPrimitives({\n+\tinitialState,\n+\treducers,\n+\trootPath = [],\n+\trootSelector = identity,\n+\tselectors\n+}) {\n+\n+\t// we need this in scope so actionCreators can refer to it\n+\tlet dispatchTree;\n+\n+\tconst reducer = createReduxReducer(reducers, initialState, rootPath);\n+\tconst selector = reduceSelectors(selectors);","path":"src/util/redux.js","position":53,"original_position":53,"commit_id":"376ce631d240c23bff694018329ba908fed9e79b","original_commit_id":"376ce631d240c23bff694018329ba908fed9e79b","user":{"login":"sodiumjoe","id":845857,"avatar_url":"https://avatars.githubusercontent.com/u/845857?v=3","gravatar_id":"","url":"https://api.github.com/users/sodiumjoe","html_url":"https://github.com/sodiumjoe","followers_url":"https://api.github.com/users/sodiumjoe/followers","following_url":"https://api.github.com/users/sodiumjoe/following{/other_user}","gists_url":"https://api.github.com/users/sodiumjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/sodiumjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodiumjoe/subscriptions","organizations_url":"https://api.github.com/users/sodiumjoe/orgs","repos_url":"https://api.github.com/users/sodiumjoe/repos","events_url":"https://api.github.com/users/sodiumjoe/events{/privacy}","received_events_url":"https://api.github.com/users/sodiumjoe/received_events","type":"User","site_admin":false},"body":"naming?\r\n\r\nI'm still leaning toward `selector` because they literally are `reselect` `selectors`.","created_at":"2016-04-22T20:52:16Z","updated_at":"2016-04-22T20:52:16Z","html_url":"https://github.com/appnexus/lucid/pull/198#discussion_r60801387","pull_request_url":"https://api.github.com/repos/appnexus/lucid/pulls/198","_links":{"self":{"href":"https://api.github.com/repos/appnexus/lucid/pulls/comments/60801387"},"html":{"href":"https://github.com/appnexus/lucid/pull/198#discussion_r60801387"},"pull_request":{"href":"https://api.github.com/repos/appnexus/lucid/pulls/198"}}},"pull_request":{"url":"https://api.github.com/repos/appnexus/lucid/pulls/198","id":67427118,"html_url":"https://github.com/appnexus/lucid/pull/198","diff_url":"https://github.com/appnexus/lucid/pull/198.diff","patch_url":"https://github.com/appnexus/lucid/pull/198.patch","issue_url":"https://api.github.com/repos/appnexus/lucid/issues/198","number":198,"state":"open","locked":false,"title":"Proposal: redux binding utilities","user":{"login":"sodiumjoe","id":845857,"avatar_url":"https://avatars.githubusercontent.com/u/845857?v=3","gravatar_id":"","url":"https://api.github.com/users/sodiumjoe","html_url":"https://github.com/sodiumjoe","followers_url":"https://api.github.com/users/sodiumjoe/followers","following_url":"https://api.github.com/users/sodiumjoe/following{/other_user}","gists_url":"https://api.github.com/users/sodiumjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/sodiumjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodiumjoe/subscriptions","organizations_url":"https://api.github.com/users/sodiumjoe/orgs","repos_url":"https://api.github.com/users/sodiumjoe/repos","events_url":"https://api.github.com/users/sodiumjoe/events{/privacy}","received_events_url":"https://api.github.com/users/sodiumjoe/received_events","type":"User","site_admin":false},"body":"## PR Checklist\r\n\r\n- Manually tested across supported browsers\r\n  - [ ] Chrome\r\n  - [ ] Firefox\r\n  - [ ] Safari\r\n  - [ ] IE11 (Win 7)\r\n  - [ ] Edge (Win 10)\r\n- [ ] Unit tests written (`common` at minimum)\r\n- [ ] PR has one of the `semver-` labels\r\n- [ ] Two core team engineer approvals\r\n- [ ] One core team UX approval\r\n- [ ] write tests\r\n- [ ] finalize names\r\n\r\n+ utility functions for getting react-redux primitives from lucid\r\n\treducers/selectors:\r\n\t+ reducer\r\n\t+ connectors (mapStateToProps, mapDispatchToProps, mergeProps)\r\n\r\n","created_at":"2016-04-21T21:41:52Z","updated_at":"2016-04-22T20:52:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32592b76ae48be7da6d92a79fdd35c1c0d11ea32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appnexus/lucid/pulls/198/commits","review_comments_url":"https://api.github.com/repos/appnexus/lucid/pulls/198/comments","review_comment_url":"https://api.github.com/repos/appnexus/lucid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appnexus/lucid/issues/198/comments","statuses_url":"https://api.github.com/repos/appnexus/lucid/statuses/376ce631d240c23bff694018329ba908fed9e79b","head":{"label":"sodiumjoe:redux-util","ref":"redux-util","sha":"376ce631d240c23bff694018329ba908fed9e79b","user":{"login":"sodiumjoe","id":845857,"avatar_url":"https://avatars.githubusercontent.com/u/845857?v=3","gravatar_id":"","url":"https://api.github.com/users/sodiumjoe","html_url":"https://github.com/sodiumjoe","followers_url":"https://api.github.com/users/sodiumjoe/followers","following_url":"https://api.github.com/users/sodiumjoe/following{/other_user}","gists_url":"https://api.github.com/users/sodiumjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/sodiumjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodiumjoe/subscriptions","organizations_url":"https://api.github.com/users/sodiumjoe/orgs","repos_url":"https://api.github.com/users/sodiumjoe/repos","events_url":"https://api.github.com/users/sodiumjoe/events{/privacy}","received_events_url":"https://api.github.com/users/sodiumjoe/received_events","type":"User","site_admin":false},"repo":{"id":54508672,"name":"lucid","full_name":"sodiumjoe/lucid","owner":{"login":"sodiumjoe","id":845857,"avatar_url":"https://avatars.githubusercontent.com/u/845857?v=3","gravatar_id":"","url":"https://api.github.com/users/sodiumjoe","html_url":"https://github.com/sodiumjoe","followers_url":"https://api.github.com/users/sodiumjoe/followers","following_url":"https://api.github.com/users/sodiumjoe/following{/other_user}","gists_url":"https://api.github.com/users/sodiumjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/sodiumjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodiumjoe/subscriptions","organizations_url":"https://api.github.com/users/sodiumjoe/orgs","repos_url":"https://api.github.com/users/sodiumjoe/repos","events_url":"https://api.github.com/users/sodiumjoe/events{/privacy}","received_events_url":"https://api.github.com/users/sodiumjoe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sodiumjoe/lucid","description":"A UI component library from AppNexus.","fork":true,"url":"https://api.github.com/repos/sodiumjoe/lucid","forks_url":"https://api.github.com/repos/sodiumjoe/lucid/forks","keys_url":"https://api.github.com/repos/sodiumjoe/lucid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sodiumjoe/lucid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sodiumjoe/lucid/teams","hooks_url":"https://api.github.com/repos/sodiumjoe/lucid/hooks","issue_events_url":"https://api.github.com/repos/sodiumjoe/lucid/issues/events{/number}","events_url":"https://api.github.com/repos/sodiumjoe/lucid/events","assignees_url":"https://api.github.com/repos/sodiumjoe/lucid/assignees{/user}","branches_url":"https://api.github.com/repos/sodiumjoe/lucid/branches{/branch}","tags_url":"https://api.github.com/repos/sodiumjoe/lucid/tags","blobs_url":"https://api.github.com/repos/sodiumjoe/lucid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sodiumjoe/lucid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sodiumjoe/lucid/git/refs{/sha}","trees_url":"https://api.github.com/repos/sodiumjoe/lucid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sodiumjoe/lucid/statuses/{sha}","languages_url":"https://api.github.com/repos/sodiumjoe/lucid/languages","stargazers_url":"https://api.github.com/repos/sodiumjoe/lucid/stargazers","contributors_url":"https://api.github.com/repos/sodiumjoe/lucid/contributors","subscribers_url":"https://api.github.com/repos/sodiumjoe/lucid/subscribers","subscription_url":"https://api.github.com/repos/sodiumjoe/lucid/subscription","commits_url":"https://api.github.com/repos/sodiumjoe/lucid/commits{/sha}","git_commits_url":"https://api.github.com/repos/sodiumjoe/lucid/git/commits{/sha}","comments_url":"https://api.github.com/repos/sodiumjoe/lucid/comments{/number}","issue_comment_url":"https://api.github.com/repos/sodiumjoe/lucid/issues/comments{/number}","contents_url":"https://api.github.com/repos/sodiumjoe/lucid/contents/{+path}","compare_url":"https://api.github.com/repos/sodiumjoe/lucid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sodiumjoe/lucid/merges","archive_url":"https://api.github.com/repos/sodiumjoe/lucid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sodiumjoe/lucid/downloads","issues_url":"https://api.github.com/repos/sodiumjoe/lucid/issues{/number}","pulls_url":"https://api.github.com/repos/sodiumjoe/lucid/pulls{/number}","milestones_url":"https://api.github.com/repos/sodiumjoe/lucid/milestones{/number}","notifications_url":"https://api.github.com/repos/sodiumjoe/lucid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sodiumjoe/lucid/labels{/name}","releases_url":"https://api.github.com/repos/sodiumjoe/lucid/releases{/id}","deployments_url":"https://api.github.com/repos/sodiumjoe/lucid/deployments","created_at":"2016-03-22T21:05:54Z","updated_at":"2016-03-22T21:05:57Z","pushed_at":"2016-04-21T21:56:46Z","git_url":"git://github.com/sodiumjoe/lucid.git","ssh_url":"git@github.com:sodiumjoe/lucid.git","clone_url":"https://github.com/sodiumjoe/lucid.git","svn_url":"https://github.com/sodiumjoe/lucid","homepage":"","size":670,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"appnexus:master","ref":"master","sha":"d5a20742e12b65029d12f6757b3bbe7bf5dba489","user":{"login":"appnexus","id":1664176,"avatar_url":"https://avatars.githubusercontent.com/u/1664176?v=3","gravatar_id":"","url":"https://api.github.com/users/appnexus","html_url":"https://github.com/appnexus","followers_url":"https://api.github.com/users/appnexus/followers","following_url":"https://api.github.com/users/appnexus/following{/other_user}","gists_url":"https://api.github.com/users/appnexus/gists{/gist_id}","starred_url":"https://api.github.com/users/appnexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appnexus/subscriptions","organizations_url":"https://api.github.com/users/appnexus/orgs","repos_url":"https://api.github.com/users/appnexus/repos","events_url":"https://api.github.com/users/appnexus/events{/privacy}","received_events_url":"https://api.github.com/users/appnexus/received_events","type":"Organization","site_admin":false},"repo":{"id":51951143,"name":"lucid","full_name":"appnexus/lucid","owner":{"login":"appnexus","id":1664176,"avatar_url":"https://avatars.githubusercontent.com/u/1664176?v=3","gravatar_id":"","url":"https://api.github.com/users/appnexus","html_url":"https://github.com/appnexus","followers_url":"https://api.github.com/users/appnexus/followers","following_url":"https://api.github.com/users/appnexus/following{/other_user}","gists_url":"https://api.github.com/users/appnexus/gists{/gist_id}","starred_url":"https://api.github.com/users/appnexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appnexus/subscriptions","organizations_url":"https://api.github.com/users/appnexus/orgs","repos_url":"https://api.github.com/users/appnexus/repos","events_url":"https://api.github.com/users/appnexus/events{/privacy}","received_events_url":"https://api.github.com/users/appnexus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appnexus/lucid","description":"A UI component library from AppNexus.","fork":false,"url":"https://api.github.com/repos/appnexus/lucid","forks_url":"https://api.github.com/repos/appnexus/lucid/forks","keys_url":"https://api.github.com/repos/appnexus/lucid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appnexus/lucid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appnexus/lucid/teams","hooks_url":"https://api.github.com/repos/appnexus/lucid/hooks","issue_events_url":"https://api.github.com/repos/appnexus/lucid/issues/events{/number}","events_url":"https://api.github.com/repos/appnexus/lucid/events","assignees_url":"https://api.github.com/repos/appnexus/lucid/assignees{/user}","branches_url":"https://api.github.com/repos/appnexus/lucid/branches{/branch}","tags_url":"https://api.github.com/repos/appnexus/lucid/tags","blobs_url":"https://api.github.com/repos/appnexus/lucid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appnexus/lucid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appnexus/lucid/git/refs{/sha}","trees_url":"https://api.github.com/repos/appnexus/lucid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appnexus/lucid/statuses/{sha}","languages_url":"https://api.github.com/repos/appnexus/lucid/languages","stargazers_url":"https://api.github.com/repos/appnexus/lucid/stargazers","contributors_url":"https://api.github.com/repos/appnexus/lucid/contributors","subscribers_url":"https://api.github.com/repos/appnexus/lucid/subscribers","subscription_url":"https://api.github.com/repos/appnexus/lucid/subscription","commits_url":"https://api.github.com/repos/appnexus/lucid/commits{/sha}","git_commits_url":"https://api.github.com/repos/appnexus/lucid/git/commits{/sha}","comments_url":"https://api.github.com/repos/appnexus/lucid/comments{/number}","issue_comment_url":"https://api.github.com/repos/appnexus/lucid/issues/comments{/number}","contents_url":"https://api.github.com/repos/appnexus/lucid/contents/{+path}","compare_url":"https://api.github.com/repos/appnexus/lucid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appnexus/lucid/merges","archive_url":"https://api.github.com/repos/appnexus/lucid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appnexus/lucid/downloads","issues_url":"https://api.github.com/repos/appnexus/lucid/issues{/number}","pulls_url":"https://api.github.com/repos/appnexus/lucid/pulls{/number}","milestones_url":"https://api.github.com/repos/appnexus/lucid/milestones{/number}","notifications_url":"https://api.github.com/repos/appnexus/lucid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appnexus/lucid/labels{/name}","releases_url":"https://api.github.com/repos/appnexus/lucid/releases{/id}","deployments_url":"https://api.github.com/repos/appnexus/lucid/deployments","created_at":"2016-02-17T19:59:27Z","updated_at":"2016-04-18T20:20:47Z","pushed_at":"2016-04-22T17:28:58Z","git_url":"git://github.com/appnexus/lucid.git","ssh_url":"git@github.com:appnexus/lucid.git","clone_url":"https://github.com/appnexus/lucid.git","svn_url":"https://github.com/appnexus/lucid","homepage":"http://appnexus.github.io/lucid","size":1646,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":28,"forks":5,"open_issues":28,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appnexus/lucid/pulls/198"},"html":{"href":"https://github.com/appnexus/lucid/pull/198"},"issue":{"href":"https://api.github.com/repos/appnexus/lucid/issues/198"},"comments":{"href":"https://api.github.com/repos/appnexus/lucid/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/appnexus/lucid/pulls/198/comments"},"review_comment":{"href":"https://api.github.com/repos/appnexus/lucid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appnexus/lucid/pulls/198/commits"},"statuses":{"href":"https://api.github.com/repos/appnexus/lucid/statuses/376ce631d240c23bff694018329ba908fed9e79b"}}}}