GithubHelp home page GithubHelp logo

Distinct ValueStream about rxdart HOT 5 OPEN

Cgende avatar Cgende commented on June 3, 2024
Distinct ValueStream

from rxdart.

Comments (5)

Cgende avatar Cgende commented on June 3, 2024 1

Ok, that'll work then when that is fixed. On a side note, is there a reason this isn't available out of the box with regular Rx dart?

from rxdart.

hoc081098 avatar hoc081098 commented on June 3, 2024

You can check my library: https://github.com/hoc081098/rxdart_ext#3-statestream

from rxdart.

Cgende avatar Cgende commented on June 3, 2024

This seems like it could work, but why does StateSubject.stream return a regular Stream instead of a ValueStream? Is the only way to get the latest value synchronously to use the StateSubject object itself? This means I would have to update the type annotations of the code that uses this.

from rxdart.

hoc081098 avatar hoc081098 commented on June 3, 2024

Thanks for pointing that, it seem to be a bug.

from rxdart.

hoc081098 avatar hoc081098 commented on June 3, 2024

I encountered the same issue 2 years ago when using Flutter & StreamBuilder, I wrote and published distinct_value_connectable_stream.
Recently, I merged it to rxdart_ext and rename DistinctValue to State (inspired by Kotlinx Coroutines StateFlow).

On a side note, is there a reason this isn't available out of the box with regular Rx.

Because StateSubject is not a standard Subject in ReactiveX (includes: PublishSubject, BehaviorSubject, AsyncSubject, ReplaySubject).
So I decided to publish it in another package (rxdart_ext) :)).
I'm afraid including it in rxdart may confuse many users.

from rxdart.

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.