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;
}
The text was updated successfully, but these errors were encountered:
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 toconnect
end
anderror
events of websocket provider. Here is part of code explaining why it happensThe text was updated successfully, but these errors were encountered: