title: Error when interconnecting ipcRenderer and ipcMain in electron
body: <p>I have configured cli angular in electron, and I have a link where it execute a function that intercomunicate ipcRenderer and ipcMain:</p>
  
  <p>html:</p>
  
  <pre><code>&lt;a (click)="check()"&gt; click &lt;/a&gt;
  </code></pre>
  
  <p>component:   </p>
  
  <pre><code>constructor(private _e: ElectronService) { }
  
  check () {
     this._e.ipcRenderer.send ('conn', 'round');
     this._e.ipcRenderer.on ('conn-st', (event, args) =&gt; {
        console.log (args);
     });
  }
  </code></pre>
  
  <p>main.js (electron):</p>
  
  <pre><code>ipcMain.on ('conn', function (event, args) {
    event.sender.send ('conn-st', 'trip');
  });
  </code></pre>
  
  <p>The problem is that when you click once, you do it once, but when you click again it does 3, then 4, 5 and so on continuously.</p>
  
  <p>And throws this error upon reaching 11:</p>
  
  <pre><code>(node:23006) Error: Possible EventEmitter memory leak detected. 11 conn-st listeners added. Use emitter.setMaxListeners() to increase limit
  </code></pre>
  
  <p>How do I end the connection between ipcRenderer and ipcMain?</p>