-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: overload of BehaviorSubject #583
Comments
Seems RxJS4 also have it, maybe simply not migrated yet? (or dropped for some reason? at least wasn't able to lookup issues) |
👎 we have been over this in RxJS and declined it then |
@mattpodwysocki I know this is a dup of my pull from ~2 years ago, but perhaps we can introduce a new type, |
@trxcllnt yes, as I said before in the old PR that I was perfectly willing to make a new Subject type but was unwilling to change the meaning of the BehaviorSubject due to its downstream dependencies with publishValue etc |
Yeah a new subject type would be OK. Or we could probably make |
Couldn't we just make all bounded buffers a special case and implement a circular buffer instead of doing splicing? |
Actually you can hack around BehaviorSubject if you don't want the first init event. const bs1 = new BehaviourSubject('ignore me');
const interface = bs1.filter(x => x !== 'ignore me');
interface.subscribe(::console.log); // wouldn't print anything, waiting for the first event But I also think something like |
So I came to the exact same conclusion when I needed to use a Is the idea of a new Subject dropped or are we just waiting for a PR ? Also I don't like |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
While building apps with Rx, I have quite often had a need for an observable that remembers its latest value, but doesn't have an initial value. Now this can be achieved by using
ReplaySubject(1)
, butReplaySubject
is 'heavier'.What I'm proposing is to extend
BehaviorSubject
so that when it didn't get passed and initial value, it would wait for first value to come in before emitting anything.Proposal:
This, to my understanding, is implemented, in RxJava's BehaviorSubject:
The text was updated successfully, but these errors were encountered: