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

Adding a event listener to Account and Remote shouldn't trigger automatic subscription #300

Closed
emoitzi opened this issue Mar 5, 2015 · 2 comments

Comments

@emoitzi
Copy link

emoitzi commented Mar 5, 2015

Both classes issue subscribe requests when listeners to certain events are added.
I believe a average developer wouldn't expect such a behavior, and thus it should be removed.

Also creating an Account triggers this behavior, because the constructor automatically adds a 'transaction' listener. IMHO this should be removed as well.

Plus I can guarantee that this functionality is not used by anyone, because it is broken:

@emoitzi emoitzi changed the title Adding an event listener to Account and Remote shouldn't trigger SubscribeRequest (broken anyway) Adding a event listener to Account and Remote shouldn't trigger SubscribeRequest (broken anyway) Mar 5, 2015
@wltsmrz
Copy link
Contributor

wltsmrz commented Mar 5, 2015

Both classes issue subscribe requests when listeners to certain events are added. I believe a average developer wouldn't expect such a behavior, and thus it should be removed.

I kind of agree. It's been discussed before but we didn't have compelling reason to change. Thanks for your input on the API. To be clear, you're suggesting a separate .subscribe() method and getting rid of automatic subscription/unsubscription via added/removed event listeners, right?

Plus I can guarantee that this functionality is not used by anyone, because it is broken:

I can guarantee that it is! under_score and camelCase methods work with Remote, Request, etc., but these under_score methods have been deprecated for a long time, so they ought to be removed.

@wltsmrz wltsmrz changed the title Adding a event listener to Account and Remote shouldn't trigger SubscribeRequest (broken anyway) Adding a event listener to Account and Remote shouldn't trigger automatic subscription Mar 5, 2015
@emoitzi
Copy link
Author

emoitzi commented Mar 5, 2015

To be clear, you're suggesting a separate .subscribe() method and getting rid of automatic subscription/unsubscription via added/removed event listeners, right?

Right.

I can guarantee that it is! under_score and camelCase methods work with Remote, Request, etc.,

Oh, I overlooked that piece. Looks like your guarantee supersedes mine. 😇

@wltsmrz wltsmrz closed this as completed Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants