-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
sampleCombine bug-like behavior #324
Comments
Hi! Thanks for the detailed report. At a first glance, this looks a lot like a diamond situation. I suggest taking a look at issues #283 and #309 for examples of other diamond cases. It's outside of the scope of xstream (as is of RxJS's scope too) to do glitch-free functional reactive programming. In the general case it's not an easy problem to solve while maintaining good performance in JS. |
Wondering about a minimal extension to xstream for glitch problem, partially. It wants to solve it not automatically, but with explicit "syncing" utilizing the fact that xstream has synchronous update semantics. "Top level" / "tickFactory" (maybe factory?, but not only, because async operators like delay) operators, which lead to starting a sync tick could check if
The only thing to change in these special "tickFactory" operators is to call to check if this Is there a similar solution to this? Or is it flawed? What am I missing? Seems reasonably easy to me. @staltz Wdyt? |
Hey folks!
I found a strange behavior of
sampleCombine
.It reproduces in case of:
input.compose(sampleCombine(derivedFromInput, independentOfInput))
- only when:derivedFromInput
(or just sameinput
) is the first parameter ofsampleCombine
input
.In such cases other parameters are independent of
input
will be one step late.Code to reproduce:
The text was updated successfully, but these errors were encountered: