-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support passive event #44
Conversation
src/globalVars.js
Outdated
@@ -5,12 +5,14 @@ | |||
'use strict'; | |||
|
|||
var EventEmitter = require('eventemitter3'); | |||
var supoortPassiveEvent = require('./lib/supportPassiveEvent'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo extra o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roderickhsiao some minor comments. Any way to reliable test this?
@gyehuda can you give me admin access to this repo?
src/lib/listen.js
Outdated
var add = 'addEventListener'; | ||
var remove = 'removeEventListener'; | ||
var eventOptions = globalVars.supportsPassive ? _assign(defaultEventOption, options) : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, but maybe add {}
as first argument to _assign to avoid changing defaultEventOption
.
@redonkulus good question about the testing, probably in functional test, but not sure if it is reliable though |
@redonkulus done. |
@redonkulus the below unit test could be added after JSDOM support passive event |
I tried to add test in functional test, but unfortunately I think functional test doesn't run for a long time, and its expecting @hankhsiao access token :P |
It looks good to me 👍 |
Thanks! |
🎅 🤶 |
released in 1.1.0 🎄 |
The follow up PR based on #43 to address #42
passing an option to the event listener instead of specifically passing
passive: true
so that we can support other event.The event object will only be passed when browser support the event object.
@hankhsiao @redonkulus @kaesonho
Note: This PR will turn passive event default to true.