SignalR Client for weapp and browser, only supports WebSocket now.
npm install
gulp
var signalR = require('yourpath/signalr-client')
var hubConnection = new signalR.HubConnection(url);
var hubProxy = hubConnection.createHubProxy(hubName);
hubProxy.on(eventName,function(...args){
})
hubConnection.started(()=>{
hubProxy.invoke(methodname,...args).then(()=>{
})
})
hubConnection.start()
started
received
connectionSlow
reconnecting
reconnected
disconnected