title: Where to put socket.io code in a component?
body: <p>I want to connect to the <code>coincap.io</code> public <code>socket.io</code> API. I have everything set up but don't know where in my component to put the <code>socket.io</code> code. Does it go in the <code>constructor</code> or <code>componentWillMount</code> or where? It's <code>socket.io</code> so it obviously always needs to be open so where in a component would that go? Here is the code I need to inject somewhere into my component: </p>
  
  <pre><code>this.socket = io.connect('http://socket.coincap.io');
  this.socket.on('connect', function(tradeMsg) {
      console.log("It worked");
  });
  </code></pre>