I'm working on a Cycle JS app using storage and state plugins.
The app use xstream as reactive library.
I'm incapped in a strange behaviour.
My streams are as this diagram
On first session var update I got this debug result:
- debug 0
- debug 1
- debug 3
PROBLEM: "Debug 2" branch is not executed
If I update the session item (so to produce a new storage event) the two branch ar all executed as expected
- debug 0
- debug 1
- debug 2
- debug 3
The same good behavior happen happen if add .remember() at "debug 0"
- debug 0
- debug 1
- debug 2
- debug 3
Even stranger, the flow work as expected if I remove filter
Without Filter (and without remember) the flow give this result since the first event
- debug 0
- debug 1
- debug 2
- debug 3
My suspect is something observe at "debug 0" before the second branch is attached and so the first event is already consumed. But how can this happen if the two branch are xs.merged together? How can one branch be executed and second not? The two branch dosen't got filters or other processing, they mererly mapTo a reducer function. Any suggestion on how to debug and resolve this situations?