-
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
repeatWhen completes() subscriber immediately when notifier completes() #2054
Comments
Confirmed. This behavior differs from v4, not immediately clear whether that's from intentional changes or a bug. Here's a demo comparing v4 to v5: http://jsbin.com/zehuqo/edit?html,js,output While I certainly could be wrong, it appears the difference in implementation is that v5 will So in the presented example what is happening is that your notifier says to What I'm talking about can be demo'd by sources which do not schedule async: http://jsbin.com/caxiso/edit?html,js,output Observable.of(1, 2, 3)
.repeatWhen(attempts =>
attempts
.delay(1000)
.take(1)
)
.subscribe(
x => console.log('Next: %s', x),
err => console.log('Error: %s', err),
() => {
console.log('Completed');
}
);
(both v4 and v5 produce the same behavior for that demo) Which behavior is "right" and expected? I can see people wanting either, depending on use cases. Either behavior we choose it probably should be documented more clearly. My gut tells me the v4 behavior is more intuitive for the most common cases. |
@slavugan your code logs complete because you're not actually passing a function, you're calling console.log immediately. Looks like a typo. |
@Blesh has volunteered to dig into this. 👍 |
@jayphelps the correct behavior is v4 as it conforms directly to the Java implementation which is the original implementation, so yes, this is a bug. |
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. |
RxJS version: 5.0.0-rc.1
Code to reproduce:
Expected behavior:
Actual behavior:
Additional information:
RxJS 4 matches the expected behavior
The text was updated successfully, but these errors were encountered: