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

Disable handlers before enabling #2085

Merged
merged 1 commit into from
Feb 8, 2016
Merged

Disable handlers before enabling #2085

merged 1 commit into from
Feb 8, 2016

Conversation

lucaswoj
Copy link
Contributor

@lucaswoj lucaswoj commented Feb 8, 2016

… in order to prevent duplicate event listeners from being bound

fixes #2069

cc @mcwhittemore @bhousel @ansis

… in order to prevent duplicate event listeners from being bound

fixes #2069
@bhousel
Copy link
Contributor

bhousel commented Feb 8, 2016

Calling disable is a good idea, but I got the impression that #2069 was more asking for these methods to be written as accessor/mutators, so that other code could get the current handler state.

handler.enabled();
// returns true/false

handler.enabled(false);
// disables handler

@mcwhittemore
Copy link
Contributor

@bhousel getters might be worthwhile, but the problem I was running into was too many callbacks being bound by calling enable when the handler was all ready enabled. This should solve that problem.

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Feb 8, 2016

Let's merge this as-is and create getters and setters if a use case emerges.

mo' state, mo' problems.

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.

Handlers should be aware of their enabled/disabled state.
4 participants