-
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
zip does not do anything if passed all iterators #4304
Labels
bug
Confirmed bug
Comments
Core team: Agree to go back to v4 style behavior and doing |
benlesh
added a commit
to benlesh/rxjs
that referenced
this issue
Sep 2, 2020
…e sources BREAKING CHANGE: `zip` operators will no longer iterate provided iterables "as needed", instead the iterables will be treated as push-streams just like they would be everywhere else in RxJS. This means that passing an endless iterable will result in the thread locking up, as it will endlessly try to read from that iterable. This puts us in-line with all other Rx implementations. To work around this, it is probably best to use `map` or some combination of `map` and `zip`. For example, `zip(source$, iterator)` could be `source$.pipe(map(value => [value, iterator.next().value]))`. fixes ReactiveX#4304
benlesh
added a commit
to benlesh/rxjs
that referenced
this issue
Sep 3, 2020
…e sources BREAKING CHANGE: `zip` operators will no longer iterate provided iterables "as needed", instead the iterables will be treated as push-streams just like they would be everywhere else in RxJS. This means that passing an endless iterable will result in the thread locking up, as it will endlessly try to read from that iterable. This puts us in-line with all other Rx implementations. To work around this, it is probably best to use `map` or some combination of `map` and `zip`. For example, `zip(source$, iterator)` could be `source$.pipe(map(value => [value, iterator.next().value]))`. fixes ReactiveX#4304
benlesh
added a commit
that referenced
this issue
Sep 3, 2020
…e sources (#5688) * fix(zip): zip operators and functions are now able to zip all iterable sources BREAKING CHANGE: `zip` operators will no longer iterate provided iterables "as needed", instead the iterables will be treated as push-streams just like they would be everywhere else in RxJS. This means that passing an endless iterable will result in the thread locking up, as it will endlessly try to read from that iterable. This puts us in-line with all other Rx implementations. To work around this, it is probably best to use `map` or some combination of `map` and `zip`. For example, `zip(source$, iterator)` could be `source$.pipe(map(value => [value, iterator.next().value]))`. fixes #4304 * chore: update golden file * chore: I hate ts-api-guardian sometimes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ages ago, I had this amazing idea to give
zip
special handling for iterables, such that, as it was "zipping" it would attempt to only next out values from the iterable as needed.Unfortunately, this has introduced a lot of complexity in that operator as well as a bug...
It should yield:
But it does nothing.
While it seemed like a clever idea at the time, I now think it deviates from the "push only" nature of RxJS, and this behavior should be removed in the upcoming v7.
The text was updated successfully, but these errors were encountered: