You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: