Skip to content
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

optimize event listener by debouncing function #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

houfeng0923
Copy link

A case in mobile app named Yahoo! JAPAN:

the match listener triggered twice (event more times) when switch page by touching stacked icon (),
this will cause the component re-instantiated.

@k-fish
Copy link
Contributor

k-fish commented May 10, 2017

Hey there and thanks for the PR.

Could you possibly include a repro case? If you want, you can extend this twiddle.

Usually a listener being called multiple times is a sign of another problem (which I'd like to narrow down). I feel like a debounce would only address the symptoms of that problem.

@houfeng0923
Copy link
Author

@k-fish yes , I also think it's another problem and it should be a bug for those browsers ,but it's hard to resolve for web developers .

I publish a twiddle code, you can open this link in Yahoo! JAPAN and touch stacked icon to reproduce it .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants