With RxJS I can use .value to synchronously get the current value of the BehaviorSubject. How can I do this with rxdart?
Hey there! We currently don't support this, but it's easy to add. I'll do it up!
That would be awesome! Thanks
@brianegan, any update on this? Is there anything I can do to help? This is currently a blocker for me.
You should be able to mimic this for now:
/// in an async method
var subject = new BehaviorSubject<String>();
subject.add('test');
var currentValue = await subject.first;
This should work, because getting the stream on a BehaviorSubject returns a deferred Stream, to which the current value is immediately added.
@brianegan I was looking for an hour right now for this attribute until I came across this issue and realized that the getter is hidden in intellisense because of same name of getter and setter. Not sure how to change that without changing the name, but I thought I should mention that here.
Use BehaviorSubject<String>(sync: true)
Most helpful comment
You should be able to mimic this for now:
This should work, because getting the
streamon aBehaviorSubjectreturns a deferredStream, to which the current value is immediately added.