-
Notifications
You must be signed in to change notification settings - Fork 19
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
Stream handling function does not obtain the actual state (it is always the initial one instead) #212
Comments
I suspect the implied design is, after all, to propagate an updated state to a stream. In that case I have a guess why it does not work actually. The problem is in the The first solution that comes to mind could be to pass So the goal now is to find a way to propagate the updated state properly, not causing such re-subscriptions with messages loss. |
@ArtemyB Thanks for opening this issue. I need to go out for a few hours, but hope to answer you later today |
@dbrattli ok, no problem. It seems like I've finally understood what's going on. I'll continue to experiment in order to find a solution. However my mind is still not completely immersed into the Rx-world, so I'm struggling a bit on the tasks that require a more deep understanding (at the same time it feels very comfortable on the high level, where it's all about just combining/composing ready-to-use functions). |
Actually putting |
At the same time my app, that has more complex structure (it also includes WebSocket-connection) still does not work properly with the fix. Don't know, could be I misunderstood the concept of the |
While building an app via this library stumbled upon a problem that I can't completely understand. Should the stream handling function be designed assuming the input model/state parameter is the actual/current state or the initial one? As I understand this code, it should get the updated state. But in my app the stream's state parameter always retains the initial value.
Example
The example is simplistic and meaningless -- it is just for demo purpose.
Brief explanation
The state contains
SavedInput : string option
, that is taken from HTML Input element after clicking "Save" button.The messages are
SaveNewInput of string
,UpperCase
andLowerCase
. The 1st one is simply propagated from the stream, the last two are ignored ifSavedInput
isNone
:The intent is to ignore the messages
UpperCase
andLowerCase
until user saves an entered string. So if the stream function obtained the actual state, the example would work properly. However in reality it always ignoresUpperCase
andLowerCase
messages, because the stream function never gets an updated state -- it always has the initial value.So this is the problem I want to clarify.
The text was updated successfully, but these errors were encountered: