title: socket.rooms value changes before "disconnecting" listener is complete
body: <p>I know that in the &quot;disconnect&quot; listener, you cannot access <code>socket.rooms</code>. However in my &quot;disconnecting&quot; listener, I make some modifications to my database, then wish to emit an event to the rest of the socket room (which aren't going through). When I place a <code>console.log(socket.rooms)</code> at the beginning of the callback, I see that it contains the name of the room I wish to emit to. However, once it reaches a callback from mongoose I <code>console.log(socket.rooms)</code> again and it is empty. What I am guessing is happening is there is an asynchronous issue where the socket disconnects before the &quot;disconnecting&quot; listener is complete. Could I somehow make it so the socket has to wait for the listener to complete before it disconnects? Here is my code:</p>
  <pre><code>socket.on('disconnecting', () =&gt; {
     console.log(socket.rooms); // not empty
     User.findOne({socketID: socket.id}, (err, user) =&gt; {
        console.log(socket.rooms); // empty
        socket.to(user.session /* this is equal to the room name */).emit('leaving', data) // not emitting;
     }
  });
  </code></pre>