Skip to content
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

updateState - stateEvent$ VS state$ #19

Open
jan-kacina opened this issue Feb 4, 2020 · 2 comments
Open

updateState - stateEvent$ VS state$ #19

jan-kacina opened this issue Feb 4, 2020 · 2 comments

Comments

@jan-kacina
Copy link

Hi Bradford,
I'm experiencing a strange behavior in a sated library composed from two data sources. In case of updateof one of them, the data from second one is not up-to-date...
I have digged through your source code and the reason of this behavior is StatedLib.ts line 105, where new rawState is constructed from this.stateEvent$.value.rawState - the value does not contain up-to-date data. When I change construction to use this.state$.value instead, the data are up-to-date from both data sources...

Is usage of this.stateEvent$.value.rawState intentional and important during new rawState construction? Or can it be considered as a typo and fixed?

Thanks in advance for explanation.

Regards,
Jan

@bradfordlemley
Copy link
Owner

Hi, thanks for trying the library! I'm not sure what you mean by "composed from two data sources" here...are you using mapState? I need a little more info or some code that exhibits the problem.

In line 105 that you mentioned, we're calculating the next rawState using the previous rawState (which should be this.stateEvent$.value.rawState). I believe it is correct, but would love to get more info from you to see if I'm missing something.

Thanks!

@jan-kacina
Copy link
Author

Thanks for quick response.
By "composed from two data sources" I mean that one data for object held in rawState are taken from two different sources, e.g. two data tables.
We are using mapState as well for composing different objects together.
I'll try to prepare simple source code for problem reproduction - current project is too heavy to explain in detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants