Giter VIP home page Giter VIP logo

Comments (2)

mradzinski avatar mradzinski commented on June 18, 2024

You're using PublishSubject<Any> = PublishSubject.create() inside BaseOrbitContainer. Subjects are great, however, they are stateful in a damaging way: when they receive an onComplete or onError they no longer become usable for moving data. So you might wanna check Relays which are basically Subjects except without the ability to call onComplete or onError.

from orbit-mvi.

Rosomack avatar Rosomack commented on June 18, 2024

Thanks for the suggestion @mradzinski. I'll explain how I understand this - please correct me if I'm wrong and let me know your thoughts!

Relays for Orbit would help in cases where upstream observables that feed into the input emit errors. However with some recent changes in 1.2.0 we no longer expose the input subject outside of an OrbitContainer or OrbitViewModel so this removes the need for the relays (we actually had them in at some point but decided to remove the extra dependency).

Not sure if we should be concerned with using relays in case of downstream observables getting errors since this is usually a user error (typically not handling and wrapping exceptions) and pretty fatal so these are the cases that we need to handle somehow. In such a case, you wouldn't be able to reuse such an OrbitContainer - relay or not.

It is usually quite difficult to find the error after this happens, so at the very least we should provide a nicer stack trace. As far as handling this gracefully it remains to be seen how far we can get with this :)

from orbit-mvi.

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.