Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unsubscribe not removing hierarchy #97

Merged
merged 2 commits into from
Oct 5, 2016
Merged

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! 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants