change to arrow functions

This commit is contained in:
Martin Gjoshevski
2017-09-08 22:50:41 +02:00
parent 1aa0fd4e1a
commit 4b7d8537cb
@@ -2,13 +2,13 @@ import { hubConnection } from 'signalr-no-jquery';
const connection = hubConnection('http://[address]:[port]');
const hubProxy = connection.createHubProxy('hubNameString');
// set up event listeners i.e. for incoming "message" event
hubProxy.on('message', function(message) {
hubProxy.on('message', (message) => {
console.log(message);
});
// connect
connection.start({ jsonp: true })
.done(function(){ console.log('Now connected, connection ID=' + connection.id); })
.fail(function(){ console.log('Could not connect'); });
.done(()=>{ console.log('Now connected, connection ID=' + connection.id); })
.fail(()=>{ console.log('Could not connect'); });