Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

add ability to register for all messages #1

merged 1 commit into from May 3, 2012


None yet
2 participants

lloyd commented May 3, 2012

hub.all() registers for all messages. it returns an integer, off() works as expected, tests updated.


@shane-tomlinson shane-tomlinson commented on the diff May 3, 2012

@@ -35,21 +52,30 @@ Hub = (function() {
for(var i = 0, listener; listener = messageListeners[i]; ++i) {
if(listener.id === id) {
messageListeners.splice(i, 1);
+ break;

@shane-tomlinson shane-tomlinson commented on the diff May 3, 2012

var id1 = hub.on("message", function() {
ok(false, "this should never be triggered");
- firstTriggered = false;
+ secondTriggered = true;

shane-tomlinson May 3, 2012


The diff confused me as to what the intent was here, but after reading the code everything was crystal clear.

shane-tomlinson added a commit that referenced this pull request May 3, 2012

Merge pull request #1 from lloyd/master
add ability to register for all messages

This is a very nice pull request for a feature that I have wanted to add myself!  Thanks @lloyd.

r+ - merging.

@shane-tomlinson shane-tomlinson merged commit f0a38a2 into shane-tomlinson:master May 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment