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

@ngrx/signalr/connected and @ngrx/signalr/disconnected actions called multiple times when revisiting page #22

Closed pstarostka-zz closed 3 years ago

pstarostka-zz commented 3 years ago

Hi, I started using this package as it's really easy to get into and really helps with the boilerplate of SignalR. However I encountered problem with specific actions being calles multple times (not unsubscribed?). @ngrx/signalr/connected and @ngrx/signalr/disconnected are called multiple times when revisiting certain pages. E.g when I leave my component, I use stopSignalRHub action in ngOnDestroy() method and the disconected action is called once, then 2x, then 4x, etc. With connected action, it's almost the same, because it goes 1,2,3... etc. using startSignalRHub in ngAfterViewInit() method.

Can you please provide some feedback on how to fix it? I don't have any subscriptions anywhere, just actions / effects. Thank you!