You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to catch end event in one place and do reconnect and resubscribe to .allEvents in another place, but I can't assign more than function to connectend and error events of websocket provider. Here is part of code explaining why it happens
WebsocketProvider.prototype.on = function (type, callback) {
if(typeof callback !== 'function')
throw new Error('The second parameter callback must be a function.');
switch(type){
case 'data':
this.notificationCallbacks.push(callback);
break;
case 'connect':
this.connection.onopen = callback;
break;
case 'end':
this.connection.onclose = callback;
break;
case 'error':
this.connection.onerror = callback;
break;
}
I'd like to catch
endevent in one place and do reconnect and resubscribe to.allEventsin another place, but I can't assign more than function toconnectendanderrorevents of websocket provider. Here is part of code explaining why it happens