-
-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hi,
I'm using localDataStorage (excellent work βππ, by the way) in a web application to manage some data that needs to be synchronized between tabs.
Using the Broadcast Channel API, all tabs receive the broadcast message to react to changes in the storage. Including the one sending the message..., and this the "issue".
To ignore messages sent from your own tab (in my web application's logic, this would result in unnecessary duplication of work), you'd need a way to identify the source/sender of each message.
I couldn't identify this with the current library logic. (Maybe I missed something and wasn't looking in the right place...)
This would be feasible if we could define a unique "sender" for each instance/tab, like this:
localData = localDataStorage(..., senderId);
// or
// localDataStorage internally to create a unique senderId to be retrieved like (I prefer this one):
senderId = localData.senderId;
This "senderId" would be part of the "event.data" that's passed in the broadcast message.
What do you think about this? Would you be willing to include this new functionality?
Thanks.