-
-
Notifications
You must be signed in to change notification settings - Fork 460
Open
Description
Dear @mroderick ,
Thanks for this awesome library 👍 .
I'm facing one issue using publish
method:
I'm using publish method on button click, to add the item in cart:
<Button onClick={() => { PubSub.publish("ADD_TO_CART", card); }} > Add to cart </Button>
and I'm listing this in another component:
PubSub.subscribe("ADD_TO_CART", function (msg, data) { console.log(data); });
but problem is, when I clicked 3-4 times on the same button, the listener prints all previous value and new value as well. is there any way to publish only latest value not the past values??
Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels