title: How to communicate between Web Components (native UI)?
body: <p>I'm trying to use native web components for one of my UI project and for this project, I'm not using any frameworks or libraries like Polymer etc. I would like to know is there any best way or other way to communicate between two web components like we do in angularjs/angular (like the message bus concept).</p>
  
  <p>Currently in UI web-components, I'm using <strong>dispatchevent</strong> for publishing data and for receiving data, I'm using <strong>addeventlistener</strong>. 
  For example, there are 2 web-components, ChatForm and ChatHistory.</p>
  
  <pre><code>// chatform webcomponent on submit text, publish chattext data 
  this.dispatchEvent(new CustomEvent('chatText', {detail: chattext}));
  
  // chathistory webcomponent, receive chattext data and append it to chat list
  this.chatFormEle.addEventListener('chatText', (v) =&gt; {console.log(v.detail);});
  </code></pre>
  
  <p>Please let me know what other ways work for this purpose. Any good library like postaljs etc. that can easily integrate with native UI web components.</p>