Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private startConnection() {
if (this.hubConnection.state === HubConnectionState.Connected) {
return;
}
this.hubConnection.start().then(
() => {
console.log('Hub connection started!');
this.connectionEstablished$.next(true);
},
error => console.error(error)
);
}