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

Make isListening immutable #45

Open
aleclarson opened this issue Oct 1, 2017 · 0 comments
Open

Make isListening immutable #45

aleclarson opened this issue Oct 1, 2017 · 0 comments
Labels

Comments

@aleclarson
Copy link
Owner

I'm considering making isListening readonly. Right now, you can set it to false to temporarily remove the listener from its associated event, and set it to true to receive events again. Currently, doing that will make the listener lose its place in the call order (assuming #43 gets fixed).

Instead, there could be a disable method for disabling the listener without losing its place, and an enable method for allowing events to be handled again. Also, a destroy method would be added for removing the listener from its event forever; which would be used for cancelling one-time listeners and automatically clearing out dereferenced listeners.

I'm curious what anyone else thinks of this change. Would the breaking change be worth it? I'm also open to suggestions on the naming of the proposed methods.

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

No branches or pull requests

1 participant