title: SocketIO dont fire first client events
body: <p>I am building a chat app. The issue is that, <code>socket.io</code> does not <code>emit</code>the <code>keypress</code> event on the first client, when fired.</p>
  
  <p>I built this with <code>Ionic 3</code> &amp; <code>Angular 5</code></p>
  
  <p><a href="https://thumb.gyazo.com/thumb/800_w/_deddb876ffc5e13958c861986d8f405a-gif" rel="nofollow noreferrer">Here's</a> the "bug"</p>
  
  <p>My view.html</p>
  
  <pre><code> &lt;p *ngIf="typing == true"&gt;... is typing&lt;/p&gt;
   &lt;ion-item no-lines&gt;
     &lt;ion-input
         type="text"
         placeholder="Message"
         [(ngModel)]="message"
         (keypress)="userIsTyping()"&gt;
     &lt;/ion-input&gt;
   &lt;/ion-item&gt;
  </code></pre>
  
  <p>My view.ts</p>
  
  <pre><code>userIsTyping() {
    this.socket.emit('typing');
    this.socket.on("updateTyping", (data) =&gt; {
      console.log('typingInSocket = ' + data.isTyping);
      this.typing = data.isTyping;
    });
    console.log('typing = ' + this.typing);
  </code></pre>
  
  <p>My server.js</p>
  
  <pre><code>io.on('connection', (socket) =&gt; {
    socket.on('typing', () =&gt; {
      socket.broadcast.emit('updateTyping', {
        isTyping: true
      });
      setTimeout(() =&gt; {
        socket.broadcast.emit('updateTyping', {
          isTyping: false
        });
      }, 2000);
    });
  </code></pre>
  
  <p>Do you have any solution ?
  Thanks you guys !</p>