-
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
fix(shareReplay): subscribe to subject before source subscription starts #5521
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I preferred the previous test - the one with the cold, synchronous marbles source. The appealing thing with the marbles is the visual aspect. The parentheses indicate the value notifications are sync and all occur at 0 ms.
The problem with using I think that the scheduler does something behind the scenes that doesn't make the observable completely cold? 🤷♂️ @voliva was the one who came up with the idea of using |
My original, suggested test had an error in it:
If it doesn't, using |
Unfortunately it doesn't - It seems like the "frame 0" on a |
Yeah, that's the error I made. The source should have had
|
Yeah, I guess that would be what's happening. Using |
yep, sorry for the mess @cartant . I've opened #5522 to demonstrate that the test using As much as I struggle with marble tests I do appreciate the value that they add by visually showing what's happening. However, in this particular case it looks like we can't use |
Could you add a comment that mentions the use of I'll have to go through the other tests later, too, as I suspect there are other places in which a source is supposed to be synchronous-upon-subscription and not just the synchronous emission of multiple notifications - e.g. here. |
a5688a4
to
502e62b
Compare
@cartant please let me know if this is good enough, or if you would like for me to change/rephrase that. (English is not my first language and I'm always trying to improve, so please don't hesitate to suggest changes to make it more understandable. |
502e62b
to
63f70a9
Compare
Description:
Addresses #5520