-
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
Add .toBehaviorSubject() and .toReplaySubject() methods #2841
Comments
Is publishBehavior the same thing? |
I'm trying to do the same thing with const connectable$ = source$.publishBehavior('initial value');
// this method is protected, and there's no other way to get access
// to the BehaviorSubject created
const behavior$ = connectable$.getSubject();
connectable$.connect(); |
It looks like we missed putting a selector on However, you can do everything in one step with source$.multicast(new ReplaySubject(3), replayed =>
replayed.map(x => x + x); // do stuff here
)
.subscribe(x => console.log(x)) |
Awesome, thanks :) |
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. |
I find it really verbose to convert an observable to either beahvior or replay subjects.
Every time I need to do this I have to:
Wouldn't be better to have shortcuts for this? Like:
I can get into the code and hack it and PR, but I'd like to hear the thoughts first. Maybe there's a reason not to have this?
Regards.
The text was updated successfully, but these errors were encountered: