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
combineLatest doesn't not work correctly with zero input streams #5039
Comments
Arrays are valid I'm not saying that this isn't confusing and cannot be improved, though. There is special-case shenanigans going on to figure out if it was passed an array of streams or multiple arguments - where each argument is a stream. rxjs/src/internal/observable/combineLatest.ts Lines 236 to 244 in b713d39
|
@cartant Changing to https://stackblitz.com/edit/rxjs-qu7wtj?file=index.ts Is there any reason for "no arguments at all" being considered an input stream? |
Yeah. I'm not saying it's not inconsistent. The inconsistency is one reason I wrote this. It's just not the sort of 'bug' that can be fixed without being deemed a breaking change. IMO any changes of this nature are going to have to wait for v8. |
I guess the workaround here is to use |
Bug Report
Current Behavior
A clear and concise description of the behavior.
combineLatest
takes an array of input streams, namely, zero or more input streams. But in the case of zero input streams, it hangs infinitely instead of emit an empty Array/Tuple ([]
).Reproduction
https://stackblitz.com/edit/rxjs-a961ph?devtoolsheight=60
Expected behavior
As per the doc:
RxJS should follow the conventional definition of each/every in algorithms, for a zero length sequence, its
.every(criteria)
is alwaystrue
.Environment
Possible Solution
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
Relates to #3189
The text was updated successfully, but these errors were encountered: