I have integrated
"@aspnet/signalr": "^1.1.4",
into my Angular 8 project.
However, it seems like the documentation provided is not up to date?
https://learn.microsoft.com/en-us/aspnet/core/signalr/javascript-client?view=aspnetcore-3.1
The documentation mentions a method
withAutomaticReconnect()
that should be used like this:
const connection = new signalR.HubConnectionBuilder()
.withUrl("/chatHub")
.withAutomaticReconnect()
.build();
But when I try to use this method, I encounter this error message:
Property 'WithAutomaticReconnect' does not exist on type 'HubConnectionBuilder'
Is this a case of outdated documentation or am I missing something in the configuration?
This is how my code looks BEFORE trying to add the aforementioned method:
private _hubConnection: HubConnection;
...
this._hubConnection = new HubConnectionBuilder()
.withUrl(this.myAPIUrl + '/myHub', { accessTokenFactory: () => tokenFromCache })
.configureLogging(signalR.LogLevel.Error)
.build();