title: Socket.io - listener must be a function on socket.io event
body: <p>I'm trying to rewrite my socket.io server in order to dodge the "callback hell" thing. Now I'm trying to listen for an event, and instead of passing an anonymus function as callback, I want to pass a function exported by a module.</p>
  
  <p>Basically I want to do this</p>
  
  <pre><code>socket.on('joinChat', myFuncExportedByModule(/* stuff */));
  </code></pre>
  
  <p>Instead of this</p>
  
  <pre><code>socket.on('joinChat', function() {
      /* stuff */
  });
  </code></pre>
  
  <p>As soon as I tried to invoke myFuncExportedByModule, node sent me back an "TypeError: listener must be a function".</p>
  
  <p>Any ideas?</p>