Skip to content

Conversation

@jbutz
Copy link
Contributor

@jbutz jbutz commented Sep 8, 2016

I noticed that the following example did not function as stated. I looked into the issue and found that only the topic with an exact match was removed. Then I looked into why the unit tests were passing and noticed the publish was occurring on the wrong topic to test that the hierarchy had been removed.

PubSub.subscribe('a', myFunc1);
PubSub.subscribe('a.b', myFunc2);
PubSub.subscribe('a.b.c', myFunc3);

PubSub.unsubscribe('a.b');
// no further notications for 'a.b' and 'a.b.c' topics
// notifications for 'a' will still get published

@jbutz jbutz changed the title Unsubscribe not remove hierarchy Unsubscribe not removing hierarchy Sep 12, 2016
@mroderick
Copy link
Owner

Thank you for your investigation and your PR! 👍

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.

2 participants