How to unsubscribe iron-signal?

13 views
Skip to first unread message

Kesavamoorthi Subramanian

unread,
Aug 4, 2016, 3:42:09 PM8/4/16
to Polymer
Hi,

I have a list of custom elements in a web page that uses iron-signal to receive multiple broadcast messages. For example, there are two custom elements A and B. A subscribed to broadcast messages X and Y. B subscribed to broadcast messages X, Y and Z. I will show/hide element A based on some condition. Now I want to unsuscribe A from receiving messages X and Y when it is hidden and re-suscribe when it is active. I know that I can keep the state of the element A in a variable and stop processing the messages. But I don't want that. What do I want is a subscribe and unsubscribe feature using iron-signal. Is it possible?

Reply all
Reply to author
Forward
0 new messages