Comments (11)
There could be multiple connections (the observable is cold) so there is no one error status (unless you make the observable hot or shared). The errors are reported on the messages
stream, check the "reconnect on error" example from the readme.
from rxjs-websockets.
onclose can be detected by the connectionStatus stream decrementing, which is easy using the pairwise operator, and extra easy if you make the messages observable shared/hot (in which case the connection status can only increment to one or decrementing to zero).
from rxjs-websockets.
You can also just detect the end of the messages stream for onclose.
from rxjs-websockets.
retryWhen is undefined even when I import it:
import { retryWhen } from 'rxjs/operators'
from rxjs-websockets.
That requires rxjs 5.5 or above.
from rxjs-websockets.
I do have 5.5.6?
from rxjs-websockets.
Try stack overflow or debugging.
from rxjs-websockets.
Maybe you're confusing pipeable operators with the old style, I dunno, I can't see your code.
from rxjs-websockets.
See https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md
from rxjs-websockets.
Thanks. I had to import rxjs/Rx, instead of rxjs/Observable.
But now I could not see how I would detect the error. Yes, it repeats the message but I never see console.log(message)
.
this.conn.messages.retryWhen(errors => errors.delay(1000)).subscribe(message=>{console.log(message)})
from rxjs-websockets.
You should not be importing rxjs/Rx. This will balloon your build size. You should be using pipeable operators now, not instance methods.
It really sounds like you need to learn rxjs before learning rxjs-websockets.
from rxjs-websockets.
Related Issues (20)
- 7.0+ API difficult to reason about HOT 2
- Unsubscribe doesn't close the connection in every case HOT 3
- Using proxy path HOT 1
- Socket disconnection status not propagating to parent component HOT 4
- RxJS 7.x compat HOT 2
- Dependency Dashboard
- Add exports field to support newer versions of nodejs HOT 3
- `complete` call-back is not getting triggered
- Compatibility with angular 16
- DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS. HOT 3
- the reconect problem with input HOT 1
- npm install -S? HOT 1
- Type errors on WebSocket Factory HOT 5
- Catching Websocket Connection Errors in ConnectionStatus Observable HOT 2
- Please Include License File HOT 2
- How to make use of this in angular 4 project? HOT 2
- `takeUntil` on messages is not closing the connection HOT 3
- Omitting protocol parameter to websocketConnect() results in bad header on Firefox HOT 1
- Angular 6 service HOT 5
- Cannot close websocket before open HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxjs-websockets.