jStorage icon indicating copy to clipboard operation
jStorage copied to clipboard

How to ignore subscribed publications for the current tab?

Open bridgeport opened this issue 11 years ago • 0 comments

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.

bridgeport avatar Jan 16 '14 03:01 bridgeport