{"action":"created","comment":{"url":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/comments/82525717","pull_request_review_id":3428388,"id":82525717,"diff_hunk":"@@ -13,3 +14,19 @@ export const removeEventListener = canUseDOM && 'removeEventListener' in window;\n // IE8+ Support\n export const attachEvent = canUseDOM && 'attachEvent' in window;\n export const detachEvent = canUseDOM && 'detachEvent' in window;\n+\n+// Passive options\n+// Inspired by https://github.com/Modernizr/Modernizr/blob/master/feature-detects/dom/passiveeventlisteners.js\n+export const passiveOption = () => {","path":"src/supports.js","position":13,"original_position":13,"commit_id":"15fa3384ebf6e948516593c92bb6be229904fd61","original_commit_id":"15fa3384ebf6e948516593c92bb6be229904fd61","user":{"login":"tsuyoshiwada","id":5393238,"avatar_url":"https://avatars.githubusercontent.com/u/5393238?v=3","gravatar_id":"","url":"https://api.github.com/users/tsuyoshiwada","html_url":"https://github.com/tsuyoshiwada","followers_url":"https://api.github.com/users/tsuyoshiwada/followers","following_url":"https://api.github.com/users/tsuyoshiwada/following{/other_user}","gists_url":"https://api.github.com/users/tsuyoshiwada/gists{/gist_id}","starred_url":"https://api.github.com/users/tsuyoshiwada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsuyoshiwada/subscriptions","organizations_url":"https://api.github.com/users/tsuyoshiwada/orgs","repos_url":"https://api.github.com/users/tsuyoshiwada/repos","events_url":"https://api.github.com/users/tsuyoshiwada/events{/privacy}","received_events_url":"https://api.github.com/users/tsuyoshiwada/received_events","type":"User","site_admin":false},"body":"That makes total sense. I would like trying to fix in pattern 2 :)","created_at":"2016-10-09T16:22:40Z","updated_at":"2016-10-09T16:22:40Z","html_url":"https://github.com/oliviertassinari/react-event-listener/pull/13#discussion_r82525717","pull_request_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/comments/82525717"},"html":{"href":"https://github.com/oliviertassinari/react-event-listener/pull/13#discussion_r82525717"},"pull_request":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13","id":88537616,"html_url":"https://github.com/oliviertassinari/react-event-listener/pull/13","diff_url":"https://github.com/oliviertassinari/react-event-listener/pull/13.diff","patch_url":"https://github.com/oliviertassinari/react-event-listener/pull/13.patch","issue_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/issues/13","number":13,"state":"open","locked":false,"title":"add / removeEventListener passive options","user":{"login":"tsuyoshiwada","id":5393238,"avatar_url":"https://avatars.githubusercontent.com/u/5393238?v=3","gravatar_id":"","url":"https://api.github.com/users/tsuyoshiwada","html_url":"https://github.com/tsuyoshiwada","followers_url":"https://api.github.com/users/tsuyoshiwada/followers","following_url":"https://api.github.com/users/tsuyoshiwada/following{/other_user}","gists_url":"https://api.github.com/users/tsuyoshiwada/gists{/gist_id}","starred_url":"https://api.github.com/users/tsuyoshiwada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsuyoshiwada/subscriptions","organizations_url":"https://api.github.com/users/tsuyoshiwada/orgs","repos_url":"https://api.github.com/users/tsuyoshiwada/repos","events_url":"https://api.github.com/users/tsuyoshiwada/events{/privacy}","received_events_url":"https://api.github.com/users/tsuyoshiwada/received_events","type":"User","site_admin":false},"body":"### Description\r\n\r\nAdded support for passive options for performance improvements such as `onscroll` and `touchmove` and etc.\r\n\r\n#### Usage\r\n\r\n```javascript\r\nimport React, {Component} from 'react';\r\nimport EventListener, {withOptions} from 'react-event-listener';\r\n\r\nclass MyComponent extends Component {\r\n  handleScroll = () => {\r\n    console.log('scroll');\r\n  };\r\n\r\n  render() {\r\n    return <EventListener\r\n      target=\"window\"\r\n      onScroll={withOptions(this.handleScroll, {passive: true, capture: false})}\r\n    />;\r\n  }\r\n}\r\n```\r\n\r\n### Note: \r\n\r\n* Added dependency of `object-assign`. (For default value merge and cross browser support)\r\n\r\n\r\n### Related Issues\r\n\r\n* [add / removeEventListener passive options? · Issue #11 · oliviertassinari/react-event-listener](https://github.com/oliviertassinari/react-event-listener/issues/11)\r\n\r\nCloses #11.","created_at":"2016-10-08T07:42:36Z","updated_at":"2016-10-09T16:22:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91239f2c47319f7c734df765a408bf6d0b982844","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13/commits","review_comments_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13/comments","review_comment_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/issues/13/comments","statuses_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/statuses/15fa3384ebf6e948516593c92bb6be229904fd61","head":{"label":"tsuyoshiwada:event-listener-options","ref":"event-listener-options","sha":"15fa3384ebf6e948516593c92bb6be229904fd61","user":{"login":"tsuyoshiwada","id":5393238,"avatar_url":"https://avatars.githubusercontent.com/u/5393238?v=3","gravatar_id":"","url":"https://api.github.com/users/tsuyoshiwada","html_url":"https://github.com/tsuyoshiwada","followers_url":"https://api.github.com/users/tsuyoshiwada/followers","following_url":"https://api.github.com/users/tsuyoshiwada/following{/other_user}","gists_url":"https://api.github.com/users/tsuyoshiwada/gists{/gist_id}","starred_url":"https://api.github.com/users/tsuyoshiwada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsuyoshiwada/subscriptions","organizations_url":"https://api.github.com/users/tsuyoshiwada/orgs","repos_url":"https://api.github.com/users/tsuyoshiwada/repos","events_url":"https://api.github.com/users/tsuyoshiwada/events{/privacy}","received_events_url":"https://api.github.com/users/tsuyoshiwada/received_events","type":"User","site_admin":false},"repo":{"id":70129929,"name":"react-event-listener","full_name":"tsuyoshiwada/react-event-listener","owner":{"login":"tsuyoshiwada","id":5393238,"avatar_url":"https://avatars.githubusercontent.com/u/5393238?v=3","gravatar_id":"","url":"https://api.github.com/users/tsuyoshiwada","html_url":"https://github.com/tsuyoshiwada","followers_url":"https://api.github.com/users/tsuyoshiwada/followers","following_url":"https://api.github.com/users/tsuyoshiwada/following{/other_user}","gists_url":"https://api.github.com/users/tsuyoshiwada/gists{/gist_id}","starred_url":"https://api.github.com/users/tsuyoshiwada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsuyoshiwada/subscriptions","organizations_url":"https://api.github.com/users/tsuyoshiwada/orgs","repos_url":"https://api.github.com/users/tsuyoshiwada/repos","events_url":"https://api.github.com/users/tsuyoshiwada/events{/privacy}","received_events_url":"https://api.github.com/users/tsuyoshiwada/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tsuyoshiwada/react-event-listener","description":"A React component for binding events on the global scope. :dizzy:","fork":true,"url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener","forks_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/forks","keys_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/teams","hooks_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/hooks","issue_events_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/issues/events{/number}","events_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/events","assignees_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/assignees{/user}","branches_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/branches{/branch}","tags_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/tags","blobs_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/git/refs{/sha}","trees_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/statuses/{sha}","languages_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/languages","stargazers_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/stargazers","contributors_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/contributors","subscribers_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/subscribers","subscription_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/subscription","commits_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/commits{/sha}","git_commits_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/git/commits{/sha}","comments_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/comments{/number}","issue_comment_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/issues/comments{/number}","contents_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/contents/{+path}","compare_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/merges","archive_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/downloads","issues_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/issues{/number}","pulls_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/pulls{/number}","milestones_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/milestones{/number}","notifications_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/labels{/name}","releases_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/releases{/id}","deployments_url":"https://api.github.com/repos/tsuyoshiwada/react-event-listener/deployments","created_at":"2016-10-06T06:52:01Z","updated_at":"2016-10-06T06:52:02Z","pushed_at":"2016-10-08T09:54:22Z","git_url":"git://github.com/tsuyoshiwada/react-event-listener.git","ssh_url":"git@github.com:tsuyoshiwada/react-event-listener.git","clone_url":"https://github.com/tsuyoshiwada/react-event-listener.git","svn_url":"https://github.com/tsuyoshiwada/react-event-listener","homepage":"","size":48,"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":"oliviertassinari:master","ref":"master","sha":"ad17648f03d2d5bf7b90d27c49bb27db1b3eb365","user":{"login":"oliviertassinari","id":3165635,"avatar_url":"https://avatars.githubusercontent.com/u/3165635?v=3","gravatar_id":"","url":"https://api.github.com/users/oliviertassinari","html_url":"https://github.com/oliviertassinari","followers_url":"https://api.github.com/users/oliviertassinari/followers","following_url":"https://api.github.com/users/oliviertassinari/following{/other_user}","gists_url":"https://api.github.com/users/oliviertassinari/gists{/gist_id}","starred_url":"https://api.github.com/users/oliviertassinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliviertassinari/subscriptions","organizations_url":"https://api.github.com/users/oliviertassinari/orgs","repos_url":"https://api.github.com/users/oliviertassinari/repos","events_url":"https://api.github.com/users/oliviertassinari/events{/privacy}","received_events_url":"https://api.github.com/users/oliviertassinari/received_events","type":"User","site_admin":false},"repo":{"id":37096474,"name":"react-event-listener","full_name":"oliviertassinari/react-event-listener","owner":{"login":"oliviertassinari","id":3165635,"avatar_url":"https://avatars.githubusercontent.com/u/3165635?v=3","gravatar_id":"","url":"https://api.github.com/users/oliviertassinari","html_url":"https://github.com/oliviertassinari","followers_url":"https://api.github.com/users/oliviertassinari/followers","following_url":"https://api.github.com/users/oliviertassinari/following{/other_user}","gists_url":"https://api.github.com/users/oliviertassinari/gists{/gist_id}","starred_url":"https://api.github.com/users/oliviertassinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliviertassinari/subscriptions","organizations_url":"https://api.github.com/users/oliviertassinari/orgs","repos_url":"https://api.github.com/users/oliviertassinari/repos","events_url":"https://api.github.com/users/oliviertassinari/events{/privacy}","received_events_url":"https://api.github.com/users/oliviertassinari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oliviertassinari/react-event-listener","description":"A React component for binding events on the global scope. :dizzy:","fork":false,"url":"https://api.github.com/repos/oliviertassinari/react-event-listener","forks_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/forks","keys_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/teams","hooks_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/hooks","issue_events_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/issues/events{/number}","events_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/events","assignees_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/assignees{/user}","branches_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/branches{/branch}","tags_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/tags","blobs_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/git/refs{/sha}","trees_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/statuses/{sha}","languages_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/languages","stargazers_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/stargazers","contributors_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/contributors","subscribers_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/subscribers","subscription_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/subscription","commits_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/commits{/sha}","git_commits_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/git/commits{/sha}","comments_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/comments{/number}","issue_comment_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/issues/comments{/number}","contents_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/contents/{+path}","compare_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/merges","archive_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/downloads","issues_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/issues{/number}","pulls_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls{/number}","milestones_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/milestones{/number}","notifications_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/labels{/name}","releases_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/releases{/id}","deployments_url":"https://api.github.com/repos/oliviertassinari/react-event-listener/deployments","created_at":"2015-06-08T22:31:30Z","updated_at":"2016-10-05T15:55:50Z","pushed_at":"2016-10-08T07:42:36Z","git_url":"git://github.com/oliviertassinari/react-event-listener.git","ssh_url":"git@github.com:oliviertassinari/react-event-listener.git","clone_url":"https://github.com/oliviertassinari/react-event-listener.git","svn_url":"https://github.com/oliviertassinari/react-event-listener","homepage":"","size":47,"stargazers_count":44,"watchers_count":44,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13"},"html":{"href":"https://github.com/oliviertassinari/react-event-listener/pull/13"},"issue":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/issues/13"},"comments":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/oliviertassinari/react-event-listener/statuses/15fa3384ebf6e948516593c92bb6be229904fd61"}}}}
{"actor":{"display_login":"tsuyoshiwada"}}