-
Notifications
You must be signed in to change notification settings - Fork 28
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
Receive state #122
Receive state #122
Conversation
@aohua Hoping you can provide some feedback. |
@aohua Anything I can do to help get this change included? If we want to avoid breaking changes for people with the current order of arguments for example. |
Hi @rowrowrowrow Thanks for your PR, but I think the init function is only supposed to be triggered once, storing the initial state may not be very useful in most of the use cases. I'm currently converting the entire project to TS and trying to improve the init process, I will consider this if there is a valid use case for it, and this is a breaking change I might include it together with other major updates. |
Hey @aohua, thanks for taking the time to consider the PR. I think that adding a receiveState function is necessary as the prepareState function is currently used both for sending AND receiving state. The issue is when you receive state you may have existing state that shouldn't be overwritten by the incoming state for whatever reason. So without a receiveState function, which receives both the existing and incoming states as arguments, I don't think there is a way to reconcile the two. e.g. this should also resolve #108 |
cd18f20
to
5b6313b
Compare
I rebased the commit on master. |
@aohua Is there anything I can do to help with this? |
@aohua bump! Thanks |
Thanks @rowrowrowrow merged and released with version 3.1.4 |
@rowrowrowrow Could you help to update the Readme file as well? Thanks |
I think sticking to the previous -> next state convention makes reconciling the incoming easy to use.