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 Request: Subscribe to multiple channels #46

Open
julkue opened this issue Feb 11, 2015 · 2 comments
Open

Feature Request: Subscribe to multiple channels #46

julkue opened this issue Feb 11, 2015 · 2 comments

Comments

@julkue
Copy link

julkue commented Feb 11, 2015

Feature Request: It should be possible to subscribe to multiple channels, e.g. separated by a ,. A example would look like: mediator.subscribe("channelOne, channelTwo", function(){}); like in the jQuery syntax.

@ajacksified
Copy link
Owner

It's good practice (especially to make debugging easier) to use a named function, which would look like:

mediator.subscribe('channelOne', fn);
mediator.subscribe('channelTwo', fn);

Which, to me, seems pretty reasonable. It might be even better if we implemented chaining:

mediator
  .subscribe('channelOne', fn)
  .subscribe('channelTwo', fn);

Or, failing those two, maybe an array:

mediator.subscribe(['channelOne', 'channelTwo'], fn);

I prefer the last example over string manipulation if we were to implement something like that.

@julkue
Copy link
Author

julkue commented Feb 11, 2015

+1 for the last example

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

No branches or pull requests

2 participants