Skip to content

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

@bridgeport

Description

@bridgeport

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions