svelte-legos icon indicating copy to clipboard operation
svelte-legos copied to clipboard

fix: history middleware does not work with nested objects

Open FranckPoingt opened this issue 1 year ago • 1 comments

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 avatar Dec 02 '23 03:12 FranckPoingt

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

ankurrsinghal avatar May 24 '24 02:05 ankurrsinghal