Code Monkey home page Code Monkey logo

Comments (11)

insidewhy avatar insidewhy commented on June 3, 2024

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.

insidewhy avatar insidewhy commented on June 3, 2024

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.

insidewhy avatar insidewhy commented on June 3, 2024

You can also just detect the end of the messages stream for onclose.

from rxjs-websockets.

emnkoksal avatar emnkoksal commented on June 3, 2024

retryWhen is undefined even when I import it:
import { retryWhen } from 'rxjs/operators'

from rxjs-websockets.

insidewhy avatar insidewhy commented on June 3, 2024

That requires rxjs 5.5 or above.

from rxjs-websockets.

emnkoksal avatar emnkoksal commented on June 3, 2024

I do have 5.5.6?

from rxjs-websockets.

insidewhy avatar insidewhy commented on June 3, 2024

Try stack overflow or debugging.

from rxjs-websockets.

insidewhy avatar insidewhy commented on June 3, 2024

Maybe you're confusing pipeable operators with the old style, I dunno, I can't see your code.

from rxjs-websockets.

insidewhy avatar insidewhy commented on June 3, 2024

See https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md

from rxjs-websockets.

emnkoksal avatar emnkoksal commented on June 3, 2024

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.

insidewhy avatar insidewhy commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.