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

Feature: ability to pause events also #67

Closed
moos opened this issue Jan 22, 2019 · 3 comments
Closed

Feature: ability to pause events also #67

moos opened this issue Jan 22, 2019 · 3 comments
Assignees
Labels
enhancement A new feature or improvement to an existing feature.

Comments

@moos
Copy link

moos commented Jan 22, 2019

After reaching idle state, I'd like the component to be a no-op. Currently, events are still bound (potential perf issue), and handlers still called (unless stopOnIdle=true). Calling this.idleTimer.componentWillUnmount() does the trick - but it's not semantically correct.

Would prefer a this.idleTimer.destroy() (or similar) or have 'stopOnIdle' include events binding also. Thoughts?

@SupremeTechnopriest
Copy link
Owner

SupremeTechnopriest commented Jan 22, 2019 via email

@SupremeTechnopriest SupremeTechnopriest self-assigned this Jan 22, 2019
@SupremeTechnopriest SupremeTechnopriest added the enhancement A new feature or improvement to an existing feature. label Jan 22, 2019
@SupremeTechnopriest
Copy link
Owner

@moos Hey buddy, thanks for your input here. Good stuff. I implemented dynamic event binding and it is published as version 4.2.0. The functionality that you requested should happen automagically for you, but if you want to manually bind or unbind the events, you can call the private methods directly this.idleTimerRef._bindEvents() and this.idleTimerRef._unbindEvents().

@moos
Copy link
Author

moos commented Jan 28, 2019

Works great - thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement to an existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants