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

Not all subscriber functions get called when unsubscribing from within #43

Closed
zarko-tg opened this issue Feb 11, 2014 · 4 comments · Fixed by #44
Closed

Not all subscriber functions get called when unsubscribing from within #43

zarko-tg opened this issue Feb 11, 2014 · 4 comments · Fixed by #44

Comments

@zarko-tg
Copy link

Please have a look at this demo: http://jsbin.com/pequr/10/edit?html,console,output
Is the use-case valid or is this a bug / deficiency?

@mroderick
Copy link
Owner

That's definitely a bug! Thank you for reporting it!

@zarko-tg
Copy link
Author

Np. Also, to top it up, I may have found yet another issue, though not sure if it's related - Making couple of (quick) calls to subscribe on same topic didn't always return tokens.
For the time being I'll have to look further to another pub/sub library but I really enjoy the simplicity of PubSubJS.

@mroderick
Copy link
Owner

Making couple of (quick) calls to subscribe on same topic didn't always return tokens.

That sounds very strange to me. Can you describe the error in further detail?

mroderick added a commit that referenced this issue Feb 11, 2014
Assert that all subscribers are called, even if some are unsubscribed during publishing
mroderick added a commit that referenced this issue Feb 11, 2014
Refactor the internals to not use arrays, so we are free to modify the list of subscribers without causing problems.
mroderick added a commit that referenced this issue Feb 11, 2014
…-unsubscription

#43 call all subscribers despite unsubscription
@zarko-tg
Copy link
Author

Re. my last comment, please ignore it because I am not able to isolate that case right now.
Thanks for the #44 fix.

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 a pull request may close this issue.

2 participants