-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Circular dependency with take(1) reaches Maximum call stack size #158
Comments
The code confused me at first but not matter how fancy the middle transformation is const a = xs.of(1);
a.imitate(a); same as const a = xs.never().startWith(1);
a.imitate(a); and const a = xs.never().startWith(1);
const b = xs.of(1).map(() => a.take(1)).flatten();
a.imitate(b); and const a = xs.never();
const b = a.startWith(1);
const c = xs.of(1).map(() => b.take(1)).flatten();
a.imitate(c); This proves how fragile mixing Subject functionality into Observable can be. It is not the code that wrong but our mental model that doesn't keep up. To me, the only mystery left is why the code does not hang immediately at this line. value$proxy.imitate(value$) but continue and allow the listener to be added. |
Opps on second though I think it is actually involve a bug. _n(t: T) { I am on my mobile phone right now and not actually testing. |
The fix is simple but I am currently figuring out how to test. |
Sorry for a lot of updates referencing this issue on my repo. |
The following code is able to reach maximum call stack size and I do not see why.
See also the log of the following webpackbin: http://www.webpackbin.com/4JfBs1HQf
(Warning: It might take a while to load and you probably don't want to save anything at the risk of crashing your browser tab)
Should not the take(1) operator prevent the proxystream from reaching maximum call stack size?
I believe this construction worked in xstream 6.0.0
The text was updated successfully, but these errors were encountered: