I propose changing this._errorSubject.next(error); to if (error) { this._errorSubject.next(error); } due to fact this._connection.onclose emits undefined in case of gracefully stopped connection and instance of Error while the error occurred.
This eliminates throw of @ngrx/signalr/stopHub action on stopSignalRHub(hub).
To fix double @ngrx/signalr/disconnected I propose removing this._stateSubject.next(disconnected); because the this._stateSubject.next would be called in this._connection.onclose after the connection stops.
Fixes issue #26
I propose changing
this._errorSubject.next(error);
toif (error) { this._errorSubject.next(error); }
due to factthis._connection.onclose
emits undefined in case of gracefully stopped connection and instance of Error while the error occurred. This eliminates throw of@ngrx/signalr/stopHub
action onstopSignalRHub(hub)
.To fix double
@ngrx/signalr/disconnected
I propose removingthis._stateSubject.next(disconnected);
because thethis._stateSubject.next
would be called inthis._connection.onclose
after the connection stops.