{"action":"created","comment":{"url":"https://api.github.com/repos/dtinth/pixelpaint/pulls/comments/238379903","pull_request_review_id":180907302,"id":238379903,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODM3OTkwMw==","diff_hunk":"@@ -0,0 +1,61 @@\n+import Immutable from 'immutable'\n+import React from 'react'\n+import { Provider, connect } from 'react-redux'\n+import createStore from './createStore'\n+import Pixel from './Pixel'\n+\n+// Reducer\n+const store = createStore((state = Immutable.Map(), action) => {\n+  if (action.type === 'TOGGLE') {\n+    const key = action.i + ',' + action.j\n+    return state.set(key, !state.get(key))\n+  }\n+  return state\n+})\n+\n+const ACTIVE_PROPS = { active: true }\n+const INACTIVE_PROPS = { active: false }\n+\n+// Connected pixel\n+const ConnectedPixel = connect(\n+  (initialState, initialProps) => {\n+    const { i, j } = initialProps\n+    return state => {","path":"src/ReduxCanvasV4.js","position":23,"original_position":23,"commit_id":"e886b5625bea5bd2fd77239f5bb651bbd6dca3ab","original_commit_id":"e886b5625bea5bd2fd77239f5bb651bbd6dca3ab","user":{"login":"amiramix","id":513941,"node_id":"MDQ6VXNlcjUxMzk0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/513941?v=4","gravatar_id":"","url":"https://api.github.com/users/amiramix","html_url":"https://github.com/amiramix","followers_url":"https://api.github.com/users/amiramix/followers","following_url":"https://api.github.com/users/amiramix/following{/other_user}","gists_url":"https://api.github.com/users/amiramix/gists{/gist_id}","starred_url":"https://api.github.com/users/amiramix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiramix/subscriptions","organizations_url":"https://api.github.com/users/amiramix/orgs","repos_url":"https://api.github.com/users/amiramix/repos","events_url":"https://api.github.com/users/amiramix/events{/privacy}","received_events_url":"https://api.github.com/users/amiramix/received_events","type":"User","site_admin":false},"body":"@markerikson Many thanks for quick response. I was confused thinking that the optimisation is done by returning `ACTIVE_PROPS` and `INACTIVE_PROPS` instead of the object, whereas the real optimisation is turned on by using a `mapStateToProps` function taking one argument instead of two.\r\n\r\nI understand the same optimization would apply if `mapStateToProps` returned an arrow function taking one argument instead of two, as was the case originally?\r\n\r\nYou are right, it's all written in the documentation but I read it so many times yet failed to understand how the optimization works. I guess it's because it's the first time I am seeing some functionality/optimization enabled by the fact that a callback takes one instead of two arguments.","created_at":"2018-12-03T18:16:15Z","updated_at":"2018-12-03T18:16:15Z","html_url":"https://github.com/dtinth/pixelpaint/pull/1#discussion_r238379903","pull_request_url":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dtinth/pixelpaint/pulls/comments/238379903"},"html":{"href":"https://github.com/dtinth/pixelpaint/pull/1#discussion_r238379903"},"pull_request":{"href":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1"}},"in_reply_to_id":91786002},"pull_request":{"url":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1","id":97371604,"node_id":"MDExOlB1bGxSZXF1ZXN0OTczNzE2MDQ=","html_url":"https://github.com/dtinth/pixelpaint/pull/1","diff_url":"https://github.com/dtinth/pixelpaint/pull/1.diff","patch_url":"https://github.com/dtinth/pixelpaint/pull/1.patch","issue_url":"https://api.github.com/repos/dtinth/pixelpaint/issues/1","number":1,"state":"open","locked":false,"title":"Add a simple but reasonably fast Redux version","user":{"login":"gaearon","id":810438,"node_id":"MDQ6VXNlcjgxMDQzOA==","avatar_url":"https://avatars0.githubusercontent.com/u/810438?v=4","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"body":"It's less efficient than V3 but also way simpler.\r\nRelies on memoization of props (which is something you want to do in intensive apps).\r\n\r\nThis gives me ~20ms for going through 32K nodes which IMO is good enough for most real apps.\r\n\r\nI used `react-redux@4.x` because it is the latest stable version and the one I optimized. I haven't participated in the 5.x effort and can't say if it is optimal for this scenario (but it does seem 1.5-2x slower).","created_at":"2016-12-09T20:05:51Z","updated_at":"2018-12-03T18:16:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf28c620dafbb3e875022f7e5b3542f97a92cace","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1/commits","review_comments_url":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1/comments","review_comment_url":"https://api.github.com/repos/dtinth/pixelpaint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dtinth/pixelpaint/issues/1/comments","statuses_url":"https://api.github.com/repos/dtinth/pixelpaint/statuses/e886b5625bea5bd2fd77239f5bb651bbd6dca3ab","head":{"label":"gaearon:redux","ref":"redux","sha":"e886b5625bea5bd2fd77239f5bb651bbd6dca3ab","user":{"login":"gaearon","id":810438,"node_id":"MDQ6VXNlcjgxMDQzOA==","avatar_url":"https://avatars0.githubusercontent.com/u/810438?v=4","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"repo":{"id":76064488,"node_id":"MDEwOlJlcG9zaXRvcnk3NjA2NDQ4OA==","name":"pixelpaint","full_name":"gaearon/pixelpaint","private":false,"owner":{"login":"gaearon","id":810438,"node_id":"MDQ6VXNlcjgxMDQzOA==","avatar_url":"https://avatars0.githubusercontent.com/u/810438?v=4","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"html_url":"https://github.com/gaearon/pixelpaint","description":"An example for my upcoming Medium article..........","fork":true,"url":"https://api.github.com/repos/gaearon/pixelpaint","forks_url":"https://api.github.com/repos/gaearon/pixelpaint/forks","keys_url":"https://api.github.com/repos/gaearon/pixelpaint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaearon/pixelpaint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaearon/pixelpaint/teams","hooks_url":"https://api.github.com/repos/gaearon/pixelpaint/hooks","issue_events_url":"https://api.github.com/repos/gaearon/pixelpaint/issues/events{/number}","events_url":"https://api.github.com/repos/gaearon/pixelpaint/events","assignees_url":"https://api.github.com/repos/gaearon/pixelpaint/assignees{/user}","branches_url":"https://api.github.com/repos/gaearon/pixelpaint/branches{/branch}","tags_url":"https://api.github.com/repos/gaearon/pixelpaint/tags","blobs_url":"https://api.github.com/repos/gaearon/pixelpaint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaearon/pixelpaint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaearon/pixelpaint/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaearon/pixelpaint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaearon/pixelpaint/statuses/{sha}","languages_url":"https://api.github.com/repos/gaearon/pixelpaint/languages","stargazers_url":"https://api.github.com/repos/gaearon/pixelpaint/stargazers","contributors_url":"https://api.github.com/repos/gaearon/pixelpaint/contributors","subscribers_url":"https://api.github.com/repos/gaearon/pixelpaint/subscribers","subscription_url":"https://api.github.com/repos/gaearon/pixelpaint/subscription","commits_url":"https://api.github.com/repos/gaearon/pixelpaint/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaearon/pixelpaint/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaearon/pixelpaint/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaearon/pixelpaint/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaearon/pixelpaint/contents/{+path}","compare_url":"https://api.github.com/repos/gaearon/pixelpaint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaearon/pixelpaint/merges","archive_url":"https://api.github.com/repos/gaearon/pixelpaint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaearon/pixelpaint/downloads","issues_url":"https://api.github.com/repos/gaearon/pixelpaint/issues{/number}","pulls_url":"https://api.github.com/repos/gaearon/pixelpaint/pulls{/number}","milestones_url":"https://api.github.com/repos/gaearon/pixelpaint/milestones{/number}","notifications_url":"https://api.github.com/repos/gaearon/pixelpaint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaearon/pixelpaint/labels{/name}","releases_url":"https://api.github.com/repos/gaearon/pixelpaint/releases{/id}","deployments_url":"https://api.github.com/repos/gaearon/pixelpaint/deployments","created_at":"2016-12-09T19:33:17Z","updated_at":"2016-12-20T13:23:03Z","pushed_at":"2016-12-09T20:02:38Z","git_url":"git://github.com/gaearon/pixelpaint.git","ssh_url":"git@github.com:gaearon/pixelpaint.git","clone_url":"https://github.com/gaearon/pixelpaint.git","svn_url":"https://github.com/gaearon/pixelpaint","homepage":null,"size":1218,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":2,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"dtinth:master","ref":"master","sha":"c8b83dae4486f1a71e3e1006046446dd79a8ca6d","user":{"login":"dtinth","id":193136,"node_id":"MDQ6VXNlcjE5MzEzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/193136?v=4","gravatar_id":"","url":"https://api.github.com/users/dtinth","html_url":"https://github.com/dtinth","followers_url":"https://api.github.com/users/dtinth/followers","following_url":"https://api.github.com/users/dtinth/following{/other_user}","gists_url":"https://api.github.com/users/dtinth/gists{/gist_id}","starred_url":"https://api.github.com/users/dtinth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtinth/subscriptions","organizations_url":"https://api.github.com/users/dtinth/orgs","repos_url":"https://api.github.com/users/dtinth/repos","events_url":"https://api.github.com/users/dtinth/events{/privacy}","received_events_url":"https://api.github.com/users/dtinth/received_events","type":"User","site_admin":false},"repo":{"id":76040335,"node_id":"MDEwOlJlcG9zaXRvcnk3NjA0MDMzNQ==","name":"pixelpaint","full_name":"dtinth/pixelpaint","private":false,"owner":{"login":"dtinth","id":193136,"node_id":"MDQ6VXNlcjE5MzEzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/193136?v=4","gravatar_id":"","url":"https://api.github.com/users/dtinth","html_url":"https://github.com/dtinth","followers_url":"https://api.github.com/users/dtinth/followers","following_url":"https://api.github.com/users/dtinth/following{/other_user}","gists_url":"https://api.github.com/users/dtinth/gists{/gist_id}","starred_url":"https://api.github.com/users/dtinth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtinth/subscriptions","organizations_url":"https://api.github.com/users/dtinth/orgs","repos_url":"https://api.github.com/users/dtinth/repos","events_url":"https://api.github.com/users/dtinth/events{/privacy}","received_events_url":"https://api.github.com/users/dtinth/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dtinth/pixelpaint","description":"An example for my upcoming Medium article..........","fork":false,"url":"https://api.github.com/repos/dtinth/pixelpaint","forks_url":"https://api.github.com/repos/dtinth/pixelpaint/forks","keys_url":"https://api.github.com/repos/dtinth/pixelpaint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dtinth/pixelpaint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dtinth/pixelpaint/teams","hooks_url":"https://api.github.com/repos/dtinth/pixelpaint/hooks","issue_events_url":"https://api.github.com/repos/dtinth/pixelpaint/issues/events{/number}","events_url":"https://api.github.com/repos/dtinth/pixelpaint/events","assignees_url":"https://api.github.com/repos/dtinth/pixelpaint/assignees{/user}","branches_url":"https://api.github.com/repos/dtinth/pixelpaint/branches{/branch}","tags_url":"https://api.github.com/repos/dtinth/pixelpaint/tags","blobs_url":"https://api.github.com/repos/dtinth/pixelpaint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dtinth/pixelpaint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dtinth/pixelpaint/git/refs{/sha}","trees_url":"https://api.github.com/repos/dtinth/pixelpaint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dtinth/pixelpaint/statuses/{sha}","languages_url":"https://api.github.com/repos/dtinth/pixelpaint/languages","stargazers_url":"https://api.github.com/repos/dtinth/pixelpaint/stargazers","contributors_url":"https://api.github.com/repos/dtinth/pixelpaint/contributors","subscribers_url":"https://api.github.com/repos/dtinth/pixelpaint/subscribers","subscription_url":"https://api.github.com/repos/dtinth/pixelpaint/subscription","commits_url":"https://api.github.com/repos/dtinth/pixelpaint/commits{/sha}","git_commits_url":"https://api.github.com/repos/dtinth/pixelpaint/git/commits{/sha}","comments_url":"https://api.github.com/repos/dtinth/pixelpaint/comments{/number}","issue_comment_url":"https://api.github.com/repos/dtinth/pixelpaint/issues/comments{/number}","contents_url":"https://api.github.com/repos/dtinth/pixelpaint/contents/{+path}","compare_url":"https://api.github.com/repos/dtinth/pixelpaint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dtinth/pixelpaint/merges","archive_url":"https://api.github.com/repos/dtinth/pixelpaint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dtinth/pixelpaint/downloads","issues_url":"https://api.github.com/repos/dtinth/pixelpaint/issues{/number}","pulls_url":"https://api.github.com/repos/dtinth/pixelpaint/pulls{/number}","milestones_url":"https://api.github.com/repos/dtinth/pixelpaint/milestones{/number}","notifications_url":"https://api.github.com/repos/dtinth/pixelpaint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dtinth/pixelpaint/labels{/name}","releases_url":"https://api.github.com/repos/dtinth/pixelpaint/releases{/id}","deployments_url":"https://api.github.com/repos/dtinth/pixelpaint/deployments","created_at":"2016-12-09T14:03:36Z","updated_at":"2018-05-29T18:25:46Z","pushed_at":"2016-12-09T20:05:51Z","git_url":"git://github.com/dtinth/pixelpaint.git","ssh_url":"git@github.com:dtinth/pixelpaint.git","clone_url":"https://github.com/dtinth/pixelpaint.git","svn_url":"https://github.com/dtinth/pixelpaint","homepage":null,"size":1572,"stargazers_count":36,"watchers_count":36,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":8,"open_issues":1,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1"},"html":{"href":"https://github.com/dtinth/pixelpaint/pull/1"},"issue":{"href":"https://api.github.com/repos/dtinth/pixelpaint/issues/1"},"comments":{"href":"https://api.github.com/repos/dtinth/pixelpaint/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/dtinth/pixelpaint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dtinth/pixelpaint/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/dtinth/pixelpaint/statuses/e886b5625bea5bd2fd77239f5bb651bbd6dca3ab"}},"author_association":"NONE"}}
{"actor":{"display_login":"amiramix"}}