title: Emit custom events in electron app from main to renderer
body: <p>So I know this works because I tried it, but it's not documented anywhere so I'm asking if it's OK to use this practice, and not worry that it would stop working in the future (Electron and nodejs are known to break things from one version to another)</p>
  
  <p>This is the type of practice I'm talking about:</p>
  
  <p>main.js</p>
  
  <pre><code>app.emit('did-something', param1, param2);
  </code></pre>
  
  <p>renderer.js (browser window)</p>
  
  <pre><code>const {app} = require('electron').remote;
  
  app.on('did-something', (param1, param2) =&gt; {
    $('#whatever').text(param1);
  });
  </code></pre>
  
  <p>Essentially I'm trying to move all the code that doesn't deal with HTML directly, like database interactions, into main.js and I want to make sure this is the right way to do it.</p>
  
  <p>Also, is it ok if I extend the app object with my own methods and properties?</p>