{"action":"created","comment":{"url":"https://api.github.com/repos/iamstarkov/theming/pulls/comments/117687492","pull_request_review_id":39412440,"id":117687492,"diff_hunk":"@@ -0,0 +1,27 @@\n+const PropTypes = require('prop-types');\n+const channel = require('./channel');\n+\n+function createThemeListener(CHANNEL = channel) {","path":"src/create-theme-listener.js","position":4,"original_position":4,"commit_id":"aa1cb576b7bfe084fc5e8964f1ca38a4b05dc94f","original_commit_id":"aa1cb576b7bfe084fc5e8964f1ca38a4b05dc94f","user":{"login":"kof","id":52824,"avatar_url":"https://avatars3.githubusercontent.com/u/52824?v=3","gravatar_id":"","url":"https://api.github.com/users/kof","html_url":"https://github.com/kof","followers_url":"https://api.github.com/users/kof/followers","following_url":"https://api.github.com/users/kof/following{/other_user}","gists_url":"https://api.github.com/users/kof/gists{/gist_id}","starred_url":"https://api.github.com/users/kof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kof/subscriptions","organizations_url":"https://api.github.com/users/kof/orgs","repos_url":"https://api.github.com/users/kof/repos","events_url":"https://api.github.com/users/kof/events{/privacy}","received_events_url":"https://api.github.com/users/kof/received_events","type":"User","site_admin":false},"body":"I would keep the channel lower case, because this mapping from lower to upper doesn't makes sense or look good. Knowing that its a constant doesn't give you any benefits when using in this way.","created_at":"2017-05-22T08:20:59Z","updated_at":"2017-05-22T08:20:59Z","html_url":"https://github.com/iamstarkov/theming/pull/3#discussion_r117687492","pull_request_url":"https://api.github.com/repos/iamstarkov/theming/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/iamstarkov/theming/pulls/comments/117687492"},"html":{"href":"https://github.com/iamstarkov/theming/pull/3#discussion_r117687492"},"pull_request":{"href":"https://api.github.com/repos/iamstarkov/theming/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/iamstarkov/theming/pulls/3","id":121669363,"html_url":"https://github.com/iamstarkov/theming/pull/3","diff_url":"https://github.com/iamstarkov/theming/pull/3.diff","patch_url":"https://github.com/iamstarkov/theming/pull/3.patch","issue_url":"https://api.github.com/repos/iamstarkov/theming/issues/3","number":3,"state":"open","locked":false,"title":"Feature: theme listener","user":{"login":"iamstarkov","id":559321,"avatar_url":"https://avatars2.githubusercontent.com/u/559321?v=3","gravatar_id":"","url":"https://api.github.com/users/iamstarkov","html_url":"https://github.com/iamstarkov","followers_url":"https://api.github.com/users/iamstarkov/followers","following_url":"https://api.github.com/users/iamstarkov/following{/other_user}","gists_url":"https://api.github.com/users/iamstarkov/gists{/gist_id}","starred_url":"https://api.github.com/users/iamstarkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamstarkov/subscriptions","organizations_url":"https://api.github.com/users/iamstarkov/orgs","repos_url":"https://api.github.com/users/iamstarkov/repos","events_url":"https://api.github.com/users/iamstarkov/events{/privacy}","received_events_url":"https://api.github.com/users/iamstarkov/received_events","type":"User","site_admin":false},"body":"as a way to create custom High-Order Components which are supposed to react to or interact with theme updates.\r\n\r\nas an example `withTheme` has been refactored and became very lightweight and simple:\r\n\r\n```jsx\r\nclass withTheme extends React.Component {\r\n  static contextTypes = themeListener.contextTypes;\r\n  constructor(props) {\r\n    super(props);\r\n    this.themeSubscribe = themeListener.subscribe.bind(this);\r\n    this.themeUnsubscribe = themeListener.unsubscribe.bind(this);\r\n  }\r\n  componentWillMount() {\r\n    this.themeSubscribe(theme => {\r\n      this.setState({ theme });\r\n    });\r\n  }\r\n  componentWillUnmount() {\r\n    this.themeUnsubscribe(this);\r\n  }\r\n  render() {\r\n    const { theme } = this.state;\r\n    return <Component theme={theme} {...this.props} />;\r\n  }\r\n};\r\n```\r\n\r\n","created_at":"2017-05-21T17:41:55Z","updated_at":"2017-05-22T08:20:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"954b39d64159a98303be11a2e3934389775c709e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/iamstarkov/theming/pulls/3/commits","review_comments_url":"https://api.github.com/repos/iamstarkov/theming/pulls/3/comments","review_comment_url":"https://api.github.com/repos/iamstarkov/theming/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iamstarkov/theming/issues/3/comments","statuses_url":"https://api.github.com/repos/iamstarkov/theming/statuses/aa1cb576b7bfe084fc5e8964f1ca38a4b05dc94f","head":{"label":"iamstarkov:feat/theme-listener","ref":"feat/theme-listener","sha":"aa1cb576b7bfe084fc5e8964f1ca38a4b05dc94f","user":{"login":"iamstarkov","id":559321,"avatar_url":"https://avatars2.githubusercontent.com/u/559321?v=3","gravatar_id":"","url":"https://api.github.com/users/iamstarkov","html_url":"https://github.com/iamstarkov","followers_url":"https://api.github.com/users/iamstarkov/followers","following_url":"https://api.github.com/users/iamstarkov/following{/other_user}","gists_url":"https://api.github.com/users/iamstarkov/gists{/gist_id}","starred_url":"https://api.github.com/users/iamstarkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamstarkov/subscriptions","organizations_url":"https://api.github.com/users/iamstarkov/orgs","repos_url":"https://api.github.com/users/iamstarkov/repos","events_url":"https://api.github.com/users/iamstarkov/events{/privacy}","received_events_url":"https://api.github.com/users/iamstarkov/received_events","type":"User","site_admin":false},"repo":{"id":89290601,"name":"theming","full_name":"iamstarkov/theming","owner":{"login":"iamstarkov","id":559321,"avatar_url":"https://avatars2.githubusercontent.com/u/559321?v=3","gravatar_id":"","url":"https://api.github.com/users/iamstarkov","html_url":"https://github.com/iamstarkov","followers_url":"https://api.github.com/users/iamstarkov/followers","following_url":"https://api.github.com/users/iamstarkov/following{/other_user}","gists_url":"https://api.github.com/users/iamstarkov/gists{/gist_id}","starred_url":"https://api.github.com/users/iamstarkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamstarkov/subscriptions","organizations_url":"https://api.github.com/users/iamstarkov/orgs","repos_url":"https://api.github.com/users/iamstarkov/repos","events_url":"https://api.github.com/users/iamstarkov/events{/privacy}","received_events_url":"https://api.github.com/users/iamstarkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iamstarkov/theming","description":"React High-Order Components for theming","fork":false,"url":"https://api.github.com/repos/iamstarkov/theming","forks_url":"https://api.github.com/repos/iamstarkov/theming/forks","keys_url":"https://api.github.com/repos/iamstarkov/theming/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iamstarkov/theming/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iamstarkov/theming/teams","hooks_url":"https://api.github.com/repos/iamstarkov/theming/hooks","issue_events_url":"https://api.github.com/repos/iamstarkov/theming/issues/events{/number}","events_url":"https://api.github.com/repos/iamstarkov/theming/events","assignees_url":"https://api.github.com/repos/iamstarkov/theming/assignees{/user}","branches_url":"https://api.github.com/repos/iamstarkov/theming/branches{/branch}","tags_url":"https://api.github.com/repos/iamstarkov/theming/tags","blobs_url":"https://api.github.com/repos/iamstarkov/theming/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iamstarkov/theming/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iamstarkov/theming/git/refs{/sha}","trees_url":"https://api.github.com/repos/iamstarkov/theming/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iamstarkov/theming/statuses/{sha}","languages_url":"https://api.github.com/repos/iamstarkov/theming/languages","stargazers_url":"https://api.github.com/repos/iamstarkov/theming/stargazers","contributors_url":"https://api.github.com/repos/iamstarkov/theming/contributors","subscribers_url":"https://api.github.com/repos/iamstarkov/theming/subscribers","subscription_url":"https://api.github.com/repos/iamstarkov/theming/subscription","commits_url":"https://api.github.com/repos/iamstarkov/theming/commits{/sha}","git_commits_url":"https://api.github.com/repos/iamstarkov/theming/git/commits{/sha}","comments_url":"https://api.github.com/repos/iamstarkov/theming/comments{/number}","issue_comment_url":"https://api.github.com/repos/iamstarkov/theming/issues/comments{/number}","contents_url":"https://api.github.com/repos/iamstarkov/theming/contents/{+path}","compare_url":"https://api.github.com/repos/iamstarkov/theming/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iamstarkov/theming/merges","archive_url":"https://api.github.com/repos/iamstarkov/theming/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iamstarkov/theming/downloads","issues_url":"https://api.github.com/repos/iamstarkov/theming/issues{/number}","pulls_url":"https://api.github.com/repos/iamstarkov/theming/pulls{/number}","milestones_url":"https://api.github.com/repos/iamstarkov/theming/milestones{/number}","notifications_url":"https://api.github.com/repos/iamstarkov/theming/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iamstarkov/theming/labels{/name}","releases_url":"https://api.github.com/repos/iamstarkov/theming/releases{/id}","deployments_url":"https://api.github.com/repos/iamstarkov/theming/deployments","created_at":"2017-04-24T21:53:51Z","updated_at":"2017-05-22T08:02:07Z","pushed_at":"2017-05-21T17:41:56Z","git_url":"git://github.com/iamstarkov/theming.git","ssh_url":"git@github.com:iamstarkov/theming.git","clone_url":"https://github.com/iamstarkov/theming.git","svn_url":"https://github.com/iamstarkov/theming","homepage":"","size":97,"stargazers_count":9,"watchers_count":9,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":9,"default_branch":"master"}},"base":{"label":"iamstarkov:dev-review","ref":"dev-review","sha":"af0faaa080d263595b74cdb9399b19e7f22a6535","user":{"login":"iamstarkov","id":559321,"avatar_url":"https://avatars2.githubusercontent.com/u/559321?v=3","gravatar_id":"","url":"https://api.github.com/users/iamstarkov","html_url":"https://github.com/iamstarkov","followers_url":"https://api.github.com/users/iamstarkov/followers","following_url":"https://api.github.com/users/iamstarkov/following{/other_user}","gists_url":"https://api.github.com/users/iamstarkov/gists{/gist_id}","starred_url":"https://api.github.com/users/iamstarkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamstarkov/subscriptions","organizations_url":"https://api.github.com/users/iamstarkov/orgs","repos_url":"https://api.github.com/users/iamstarkov/repos","events_url":"https://api.github.com/users/iamstarkov/events{/privacy}","received_events_url":"https://api.github.com/users/iamstarkov/received_events","type":"User","site_admin":false},"repo":{"id":89290601,"name":"theming","full_name":"iamstarkov/theming","owner":{"login":"iamstarkov","id":559321,"avatar_url":"https://avatars2.githubusercontent.com/u/559321?v=3","gravatar_id":"","url":"https://api.github.com/users/iamstarkov","html_url":"https://github.com/iamstarkov","followers_url":"https://api.github.com/users/iamstarkov/followers","following_url":"https://api.github.com/users/iamstarkov/following{/other_user}","gists_url":"https://api.github.com/users/iamstarkov/gists{/gist_id}","starred_url":"https://api.github.com/users/iamstarkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamstarkov/subscriptions","organizations_url":"https://api.github.com/users/iamstarkov/orgs","repos_url":"https://api.github.com/users/iamstarkov/repos","events_url":"https://api.github.com/users/iamstarkov/events{/privacy}","received_events_url":"https://api.github.com/users/iamstarkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iamstarkov/theming","description":"React High-Order Components for theming","fork":false,"url":"https://api.github.com/repos/iamstarkov/theming","forks_url":"https://api.github.com/repos/iamstarkov/theming/forks","keys_url":"https://api.github.com/repos/iamstarkov/theming/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iamstarkov/theming/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iamstarkov/theming/teams","hooks_url":"https://api.github.com/repos/iamstarkov/theming/hooks","issue_events_url":"https://api.github.com/repos/iamstarkov/theming/issues/events{/number}","events_url":"https://api.github.com/repos/iamstarkov/theming/events","assignees_url":"https://api.github.com/repos/iamstarkov/theming/assignees{/user}","branches_url":"https://api.github.com/repos/iamstarkov/theming/branches{/branch}","tags_url":"https://api.github.com/repos/iamstarkov/theming/tags","blobs_url":"https://api.github.com/repos/iamstarkov/theming/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iamstarkov/theming/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iamstarkov/theming/git/refs{/sha}","trees_url":"https://api.github.com/repos/iamstarkov/theming/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iamstarkov/theming/statuses/{sha}","languages_url":"https://api.github.com/repos/iamstarkov/theming/languages","stargazers_url":"https://api.github.com/repos/iamstarkov/theming/stargazers","contributors_url":"https://api.github.com/repos/iamstarkov/theming/contributors","subscribers_url":"https://api.github.com/repos/iamstarkov/theming/subscribers","subscription_url":"https://api.github.com/repos/iamstarkov/theming/subscription","commits_url":"https://api.github.com/repos/iamstarkov/theming/commits{/sha}","git_commits_url":"https://api.github.com/repos/iamstarkov/theming/git/commits{/sha}","comments_url":"https://api.github.com/repos/iamstarkov/theming/comments{/number}","issue_comment_url":"https://api.github.com/repos/iamstarkov/theming/issues/comments{/number}","contents_url":"https://api.github.com/repos/iamstarkov/theming/contents/{+path}","compare_url":"https://api.github.com/repos/iamstarkov/theming/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iamstarkov/theming/merges","archive_url":"https://api.github.com/repos/iamstarkov/theming/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iamstarkov/theming/downloads","issues_url":"https://api.github.com/repos/iamstarkov/theming/issues{/number}","pulls_url":"https://api.github.com/repos/iamstarkov/theming/pulls{/number}","milestones_url":"https://api.github.com/repos/iamstarkov/theming/milestones{/number}","notifications_url":"https://api.github.com/repos/iamstarkov/theming/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iamstarkov/theming/labels{/name}","releases_url":"https://api.github.com/repos/iamstarkov/theming/releases{/id}","deployments_url":"https://api.github.com/repos/iamstarkov/theming/deployments","created_at":"2017-04-24T21:53:51Z","updated_at":"2017-05-22T08:02:07Z","pushed_at":"2017-05-21T17:41:56Z","git_url":"git://github.com/iamstarkov/theming.git","ssh_url":"git@github.com:iamstarkov/theming.git","clone_url":"https://github.com/iamstarkov/theming.git","svn_url":"https://github.com/iamstarkov/theming","homepage":"","size":97,"stargazers_count":9,"watchers_count":9,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iamstarkov/theming/pulls/3"},"html":{"href":"https://github.com/iamstarkov/theming/pull/3"},"issue":{"href":"https://api.github.com/repos/iamstarkov/theming/issues/3"},"comments":{"href":"https://api.github.com/repos/iamstarkov/theming/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/iamstarkov/theming/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/iamstarkov/theming/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iamstarkov/theming/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/iamstarkov/theming/statuses/aa1cb576b7bfe084fc5e8964f1ca38a4b05dc94f"}}}}
{"actor":{"display_login":"kof"}}