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

Rename on(), off() functions to watch(), ignore() #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danhardman
Copy link

I've only renamed the fields on the returned singleton for now to keep things simple, but I think on() and off() functions don't make sense without an attributed action. Typically you'd get on('click',...) for example.

This just makes things clear that you're setting up a watcher/listener on the CSS selector.

I've only renamed the fields on the returned singleton for now to keep things simple, but I think `on()` and `off()` functions don't make sense without an attributed action. Typically you'd get `on('click',...)` for example.

This just makes things clear that you're setting up a watcher/listener on the CSS selector.
@amorey
Copy link
Member

amorey commented Sep 18, 2017

Thanks! Let me think about it some more. I used on/off for symmetry with jQuery but I like watch(). What do you think of disconnect() instead of ignore()?

@danhardman
Copy link
Author

Yeah it kinda clicked that ignore() probably isn't the best name if its intended to only work when a watcher is already setup on that selector. disconnect() or stop() I think would work well.

@distums
Copy link

distums commented Sep 19, 2017

How about observe() and disconnect()? MutationObserver has these methods.

@leipert
Copy link

leipert commented Sep 20, 2017

What about subscribe() and unsubscribe() like with es6 observables [1]

[1]: https://github.com/tc39/proposal-observable#example-observing-keyboard-events

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.

4 participants