title: NodeJS Electron app.on('ready', ...) question
body: <p>I have an app that on ready calls this function from a module.</p>
  
  <pre><code>// APP READY
  app.on('ready', createWindow.main);
  </code></pre>
  
  <p>That works without any problems.</p>
  
  <p>However when I try</p>
  
  <pre><code>app.on('ready', () =&gt; {
    console.log('Ready');
    createWindow.main;
  });
  </code></pre>
  
  <p>the console shows "Ready" but nothing happens after that.</p>
  
  <p>The idea is that I need, once the app is ready, to call different functions.</p>
  
  <p>What could be the problem here?</p>
  
  <p>I'm calling the windows.js file like this:</p>
  
  <pre><code>const createWindow = require('./windows');
  </code></pre>
  
  <hr>
  
  <p>windows.js</p>
  
  <pre><code>const {session} = require('electron');
  const app = require('electron').app;
  const BrowserWindow = require('electron').BrowserWindow;
  const url = require('url');
  const path = require('path');
  const settings = require('electron-settings');
  
  // Windows Variables
  let mainWindow;
  
  // Functions container
  var createWindow = {};
  
  // MAIN WINDOW
  createWindow.main = function() {
      console.log('Creating main window');
      mainWindow = new BrowserWindow({
        width: 800,
        height: 600
      });
  
      mainWindow.loadURL(url.format({
        protocole: 'file:',
        slashes: true,
        pathname: path.join(__dirname, 'html/index.html')
      }));
  
      mainWindow.on('closed', () =&gt; {
        mainWindow = null;
        app.quit();
      });
  
  };
  
  module.exports = createWindow;
  </code></pre>