Odonno / ngrx-signalr-core

A library to handle realtime SignalR (.NET Core) events using @angular, rxjs and the @ngrx library
https://www.npmjs.com/package/ngrx-signalr-core
MIT License
27 stars 13 forks source link

withAutomaticReconnect #37

Closed GeorgBreithaupt closed 1 year ago

GeorgBreithaupt commented 3 years ago

Would it be possible to activate "withAutoReconnect" when creating the connection? Or is there a special reason why this doesn't work?

Many Thanks!

export const createConnection = (
  url: string,
  options?: IHttpConnectionOptions | undefined
) => {
  if (!options) {
    return new HubConnectionBuilder().withUrl(url).build();
  }

  return new HubConnectionBuilder()
    .withUrl(url, options)
    .withAutomaticReconnect()
    .build();
};
Odonno commented 1 year ago

Hi @GeorgBreithaupt

If I remember correctly, this feature was not part of the first versions. Of course, since it is now part of the library, we can support this feature.

Odonno commented 1 year ago

v14.1.0 is now available with automatic reconnect feature. You can check the readme file to see how to use it.