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

How to ignore subscribed publications for the current tab? #73

Open
bridgeport opened this issue Jan 16, 2014 · 0 comments
Open

How to ignore subscribed publications for the current tab? #73

bridgeport opened this issue Jan 16, 2014 · 0 comments

Comments

@bridgeport
Copy link

First, thanks for the great script. I'm trying to wrap my head around the publish and subscribe functions and I think I got it down pretty good. I want to use them to update an array variable across browser tabs following an onclick event.

The issue I'm facing is when the onclick event happens in tab 1, it "publishes" the array variable modification to tab 2 and tab 3, but also back to tab 1. Tab 1 is subscribing to itself, which is resulting in unnecessary/duplicate actions taking place against itself.

For instance, the publisher is passing the updated array variable to tab 2 and 3 so that those tabs may update their copy. But it's also passing it back to itself in tab 1 which is overwriting the already updated copy with itself.

So my question is, is there a way to have the current tab not subscribe to itself, or to ignore publications to itself?

Thanks.

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

1 participant