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
Strange behavior from forkJoin on a Map.prototype.values iterable #4748
Comments
This is due to we expect specific (i.e I personally don't have any opinion at this moment if we'd need to support mapiterator for this or not, but curious if other operator we have supports iterables would work same way. |
|
If the code isn't intended to support mapiterator (or other iterators), that may be ok. But if that's the case, I would expect to get an error of some kind that says iterators aren't supported rather than code that silently does the wrong thing and gives a weird resposne. |
Closing this because this is the expected behaviour. If an array is passed as a single argument, that array is interpreted as the array of observable inputs. This can be seen in the TypeScript signatures, too. The behaviour is by-design. However, there is an ongoing discussion about how this sort of thing can rationalised in v7 - so that there are fewer surprises. And I agree with you that, as it is, the API's behaviour is strange. |
Bug Report
I'm trying to build a Map where the key is a string and value is an observable. I want to make an Observable that waits on all of the values in this map.
Current Behavior
The behavior seems to be weird whenever you pass in an iterable from Map.prototype.values()
Reproduction
https://stackblitz.com/edit/rxjs-jmnxda
The key part is here:
This makes the console.log statement log an array that contains a single observable with the last value of the iterable. However, if I plug the iterable into Array.from it works as I'd expect it:
Expected behavior
I'd expect the behavior to be the same for the iterable version and the array version.
Environment
The text was updated successfully, but these errors were encountered: