Skip to content
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

[rx-lite] Passing a non-natural number to repeat causes infinite loop #3415

Closed
edorivai opened this issue Mar 8, 2018 · 3 comments
Closed

Comments

@edorivai
Copy link

edorivai commented Mar 8, 2018

RxJS version:
rx-lite@4.0.8

Code to reproduce:

const Rx = require('rx-lite');

Rx.Observable.of(1)
	.repeat(2.5)
	.subscribe(i => console.log('onnext: ' + i));

Expected behavior:

Either throw an error, or repeat 2, or 3 times.

Actual behavior:

Repeats infinitely, logs:

onnext: 1
onnext: 1
onnext: 1
onnext: 1
...etc, infinitely

Additional information:

I understand that it doesn't make so much sense to pass a non natural number to repeat. In our case, the repeat count was calculated dynamically, which made it unclear that this was an issue.

@edorivai
Copy link
Author

edorivai commented Mar 8, 2018

I realize this isn't a problem in later (or "non-lite") versions, just leaving this info here for future googlers.

@kwonoj
Copy link
Member

kwonoj commented Mar 8, 2018

Rx-lite is v4 at https://github.com/Reactive-Extensions/RxJS, this repo contains v5 and further.

@lock
Copy link

lock bot commented Jun 6, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants