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

Unistore when used with stockroom not updating as expected #19

Open
Rud156 opened this issue Jul 30, 2018 · 1 comment
Open

Unistore when used with stockroom not updating as expected #19

Rud156 opened this issue Jul 30, 2018 · 1 comment

Comments

@Rud156
Copy link

Rud156 commented Jul 30, 2018

Suppose I have an initial state like:

data: {}

Make an action to return

data: [
	{
	    "userId": 1,
	    "id": 1,
	    "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
	    "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
	},
	...
]

This will not cause the store to update. In fact no errors are thrown. It just silently fails

Any idea what might be wrong.

This also happens when the initial state is null then it is updated with some data and then set back to null. The last step does not update the store.

Found #9 but its for the reverse and it works. Object to null is not working.

If I get time, I'll make an example repo to better show the issue

Update 1:

Looks like unistore/stockroom is internally using Object.assign or push/shift to set/update the states. This might be the cause of the issue

Update 2:

This issue occurs when using unistore with stockroom. Normally it works as expected

@btzr-io
Copy link

btzr-io commented Mar 7, 2019

Any updates on this ?

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