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

fix: history middleware does not work with nested objects #114

Open
FranckPoingt opened this issue Dec 2, 2023 · 1 comment
Open

fix: history middleware does not work with nested objects #114

FranckPoingt opened this issue Dec 2, 2023 · 1 comment

Comments

@FranckPoingt
Copy link

FranckPoingt commented Dec 2, 2023

Hi, I'm facing an issue with the history middleware.
It works well with properties on the top level but in my case my store looks like this:

const myStore = history(
	writable({
		a: 'a',
		b: 'b',
		c: 0,
		d: [
			{
				e: 1,
				f: {
					g: 'g',
					h: 'h'
				}
			},
                       ...
		],
               ...
	})
);

Every time I update a value part of d, I'm not able to undo or redo

@FranckPoingt FranckPoingt changed the title History middleware does not work with nested objects fix: history middleware does not work with nested objects Dec 2, 2023
@ankurrsinghal
Copy link
Owner

Can you please share an example of how you are updating the myStore for d.

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