Having some trouble retrieving the connection ID value after initializing my connection to the SignalR server (using start()) within the .done scope. Despite my efforts, I keep receiving 'undefined' for it. Any assistance in identifying the issue would be greatly appreciated. Thank you!
public establishConnection(): void
{
this.connection = $.hubConnection('http://localhost:62752');
this.proxy = this.connection.createHubProxy('ChatHub');
this.proxy.on('messageReceived', (a,b,c,d,e,f) =>
this.onMessageReceived(a,b,c,d,e,f));
this.connection.start().done((data: any) => {
console.log('Connected to Chat Hub');
this.connectionID = $.connection.hub.id;
console.log($.connection.hub.id);//undefined
this.registerConnection();
});
}