Closed NadavK closed 7 years ago
Can anyone provide a hint?
Do you finded the solution of this? Looks like this code in source
this.socket.onerror = (ev: ErrorEvent) => { // console.log('onError ', ev); self.onErrorHandler(ev); this.dataStream.error(ev); };
will internally finalize the observable.
No, I don't have a solution. Maybe I am not using the package correctly - is there a working sample code?
I'm fixed this problem by adding stream for error messages. You can watch my solution in fork.
I create a $websocket instance with the reconnect param:
{"reconnectIfNotNormalClose": true}
and the stream nicely reconnects on failures.I have a problem with incoming messages:
ws.getDataStream().subscribe
correctly fires on incoming messages until the websocket reconnects, after which it stops firing.Am I missing a step so
ws.getDataStream().subscribe
continues firing after an automatic reconnection?here is the code (comments welcome, I am new to js):
I also tried moving the
subscribe
into the stream'sonOpen
, but it behaves the same as above (fires only for the initial connection):