OLD | NEW |
1 | 1 |
2 (function(){ | 2 (function(){ |
3 /** | 3 /** |
4 `iron-signals` provides basic publish-subscribe functionality. | 4 `iron-signals` provides basic publish-subscribe functionality. |
5 | 5 |
6 Note: avoid using `iron-signals` whenever you can use | 6 Note: avoid using `iron-signals` whenever you can use |
7 a controller (parent element) to mediate communication | 7 a controller (parent element) to mediate communication |
8 instead. | 8 instead. |
9 | 9 |
10 To send a signal, fire a custom event of type `iron-signal`, with | 10 To send a signal, fire a custom event of type `iron-signal`, with |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 s.dispatchEvent(signal); | 60 s.dispatchEvent(signal); |
61 }); | 61 }); |
62 } | 62 } |
63 | 63 |
64 // signal listener at document | 64 // signal listener at document |
65 document.addEventListener('iron-signal', function(e) { | 65 document.addEventListener('iron-signal', function(e) { |
66 notify(e.detail.name, e.detail.data); | 66 notify(e.detail.name, e.detail.data); |
67 }); | 67 }); |
68 | 68 |
69 })(); | 69 })(); |
OLD | NEW |