Closed meepeek closed 6 years ago
Hey @meepeek Thank you for the issue.
I'm not sure I quite follow your text though, perhaps you could clarify a few things for me.
Is this bin not as expected: https://jsbin.com/bazibuzobu/edit?html,js,output
?
I followed your link but cannot get the output.
Could you clone https://github.com/meepeek/meiosis-react-example then run ? You will see that clicking buttons in the example and the state tracer for mixListener (scanner) would lag behind 1 step, but tapping the tracer for each individual streams work just fine. (You will have to click on each button once for mixListener to start working, not sure why.)
I honestly don't have the time to do that currently.
But if you can provide me a minimal flyd only reproducible issue, then I'd be happy to take a look.
also it seems you were routed to some strange url, this is the link to the bin: https://jsbin.com/bazibuzobu/edit?html,js,output
Feel free to use it as a baseline for your own reproducible case.
Okay I looked at your App.jsx file since I happened to have time.
https://github.com/meepeek/meiosis-react-example/blob/master/src/App.js#L12
Change this line from
const mixUpdate = flyd.merge(componentA.update, componentB.update)
to
const mixUpdate = flyd.merge(componentA.listener, componentB.listener)
And things will work like you expect
I take it by the thumbs up this issue is resolved, I'll close it, but feel free to reopen if this did not help.
As the following code:
I expect mixScan to show the result from both stream 1 and 2 updates. I did, but with a 1 step behind. Given stream1 <-- [1,2,3] then stream2 [4,5,6], this is the result for mixScan
Please find https://github.com/meepeek/meiosis-react-example for working example