How to use socket.io in Aurelia
<p>I am trying to use socket.io with the aurelia framework.
When loading the page, the data is pulled from the socket server, but afterwards, it doesn't listen.</p>

<pre><code>import io from 'socket.io-client';
var socket = io.connect( 'http://localhost:3000' );

export class Settings {
    newstate = '';

    constructor() {
        socket.on( 'users',   // &lt;- only works once (when loading the page) but doesn't listen after
            function ( userlist ) {
                this.users = userlist;
            }.bind( this ) );
    }

    addstate() {
        socket.emit( 'add state', this.newstate ); // &lt;- works flawless
        this.newstate = '';
    }
}
</code></pre>

<p>I love aurelia, but I keep failing with integrating socket.io.</p>