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

Range should be same for every subscriber. and the behavior is correct in RxJS 5.5.10. #3706

Closed
bhoomabrsr opened this issue May 17, 2018 · 3 comments

Comments

@bhoomabrsr
Copy link

bhoomabrsr commented May 17, 2018

Range is not working as expected in Rx 6.1.0
RxJS version:6.1.0

Code to reproduce:
JS Lib: https://unpkg.com/[email protected]/bundles/rxjs.umd.js

let obs$ = rxjs.range(1,5);
obs$.subscribe(console.log);
console.log('Second subscriber:');
obs$.subscribe(console.log);

output:
1
2
3
4
5
Second subscriber: //--> numbers are continuing from last end count, which is wrong
6
7
8
9
10

Expected behavior:
Range should be same for every subscriber. and the behavior is correct in RxJS 5.5.10

JS Lib: https://unpkg.com/[email protected]/bundles/Rx.js

let obs$ = Rx.Observable.range(1,5);
obs$.subscribe(console.log);
console.log('Second subscriber:');
obs$.subscribe(console.log);

output:
1
2
3
4
5
Second subscriber: //--> numbers are same for each subscriber
1
2
3
4
5

Actual behavior:
start is continuing from the previous end number

Additional information:
image

@bbonnet
Copy link
Contributor

bbonnet commented May 17, 2018

@bhoomabrsr I implemented a fix here: #3707 can you let me know if this indeed fixes the behavior you are seeing?

@bhoomabrsr bhoomabrsr changed the title Range is not working as expected in Rx 6.1.0 Range should be same for every subscriber. and the behavior is correct in RxJS 5.5.10. Range is not working as expected in Rx 6.1.0 May 18, 2018
@bhoomabrsr bhoomabrsr changed the title Range should be same for every subscriber. and the behavior is correct in RxJS 5.5.10. Range is not working as expected in Rx 6.1.0 Range should be same for every subscriber. and the behavior is correct in RxJS 5.5.10. May 18, 2018
@bhoomabrsr
Copy link
Author

bhoomabrsr commented May 18, 2018

@bbonnet, that will work.
do we need line number 49. which is current = start;
Thanks

@bbonnet
Copy link
Contributor

bbonnet commented May 18, 2018

@bhoomabrsr Good catch, dropped line 49 and it still behaves with the fix

@benlesh benlesh closed this as completed May 21, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 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

3 participants