-
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
combineLatest on synchronous sources #2414
Comments
While zip is generally applicable to lists, combineLatest is undefined without the time dimension. The current behavior is fine, because the solution is to introduce your own notion of time. Rx generally shies away from defining one for you. |
@mattpodwysocki you get this behavior from the recursive scheduler in v4. The "fix" in v5 is to use the queue scheduler. If you know of a solution that doesn't impact throughput performance, I'd be happy to change my recommendation. |
I tend to agree with @trxcllnt on this one, although I haven't commented. Forcing queue scheduling on an operator in JavaScript is like trying to force the library to mimic some sort of gated/threaded model, which the majority of JS developers know it isn't. Once it's sunk in that Given this issue has been here this long and there's been little interest, I'd say the current behavior is fine and we can close the issue. The "fix" if you want to change the behavior is to use the queue scheduler on incoming sources. |
I like the recommendation to define your own scheduling here. I disagree that |
The biggest problem I see with Rxjs v5 semantics is that order matters, which is confusing at least to me. That is to say const a$ = Rx.Observable.of(1, 2);
const b$ = Rx.Observable.of(10);
const c$ = Rx.Observable.combineLatest(a$, b$, (a,b)=>a+b);
c$.subscribe(c => console.log(c)); will output However, switch const a$ = Rx.Observable.of(1, 2);
const b$ = Rx.Observable.of(10);
const c$ = Rx.Observable.combineLatest(b$, a$, (a,b)=>a+b);
c$.subscribe(c => console.log(c)); With Rxjs v4, in both cases, the results were I'd much prefer the rxjs v4 behaviour by default, as you would expect |
For what is worth, |
RxJS version: 5.1.0
Code to reproduce:
Expected behavior:
Actual behavior:
Additional information:
I'm not sure is this a bug or a "feature". What should we do about this case? Is it just one of those "let's instruct people to choose a different scheduler if they want to have the expected behavior"?
For reference:
xstream: staltz/xstream#173
most.js: cujojs/most#414
The text was updated successfully, but these errors were encountered: