rxdart
rxdart copied to clipboard
BehaviorSubject not cleaning error after added data
I don't know why but when I add an error to BehaviorSubject and after add some data. It not cleaning any more the error. And I can't pass null to addError, So BehaviorSubject.hasError is always true.
According to https://github.com/ReactiveX/rxdart/pull/560#discussion_r590585726 of @frankpepermans This behavior was changed since 0.27.0. Should we revert or keep this?
Well, this can be looked at from many different angles as always :/
Currently hasValue and hasError just mean: "did emit value/error at a certain point"
Maybe we do need to change it again...
So that hasError/hasValue get error/value only refer to the very last emission, whereas the handlers onError/onData trigger for each emitted item.
Then we could also rename them to be less ambiguous, I.e latestIsError/latestError and latestIsValue/lastValue?
Well, this can be looked at from many different angles as always :/
Currently hasValue and hasError just mean: "did emit value/error at a certain point"
Maybe we do need to change it again...
So that hasError/hasValue get error/value only refer to the very last emission, whereas the handlers onError/onData trigger for each emitted item.
Then we could also rename them to be less ambiguous, I.e latestIsError/latestError and latestIsValue/lastValue?
I understood it. But i thinking it could have hasError like it was. All my forms using hasError to verify if is all ok. And now, is everything broke. =/
Well, this can be looked at from many different angles as always :/
Currently hasValue and hasError just mean: "did emit value/error at a certain point"
Maybe we do need to change it again...
So that hasError/hasValue get error/value only refer to the very last emission, whereas the handlers onError/onData trigger for each emitted item.
Then we could also rename them to be less ambiguous, I.e latestIsError/latestError and latestIsValue/lastValue?
I'm afraid ValueStream will have too many getters :))
I understood it. But i thinking it could have hasError like it was. All my forms using hasError to verify if is all ok. And now, is everything broke. =/
Same here, the behaviour has changed and some key behavior on all my apps are now broken, it's kind of a big deal to me. For me the error/hasError should report the status of the LATTEST value kept, otherwise it's not very usefull. So when a new value is added, error should be cleaned, and when an error is added, value should be cleaned.
Any updates?
any update about this? I'm curious how to identify if the last emitted value was an error or value? Since and last emitted error and last emitted value stored within the value stream and there is nothing that can define which one of these 2 was last
In my case, as I used rxdart just for basic usage of BehaviorSubject , I ended up creating my own basic package : value_stream
@hoc081098 one of the possible (non-breaking) solutions, it would be awesome if the upcoming release will have anything that helps to identify what last data type valuestream has. Thanks!
Thank @TatsuUkraine, I have created https://github.com/ReactiveX/rxdart/pull/729, but the method names need to be discussed.
@hoc081098 naming looks good to me
A dev release will be published in this week 😊.
@hoc081098 just curious, when these changes may go live?
@TatsuUkraine please try https://pub.dev/packages/rxdart/versions/0.28.0-dev.0 🙏
@hoc081098 hello, do you know when this change may go to stable release?
@hoc081098 hi, any updates on when these changes my go into stable?
@hoc081098 hi, any updates on when these changes my go into stable?
Hi, I will look into it 🙏