solid-record icon indicating copy to clipboard operation
solid-record copied to clipboard

Undo fails at reverting additions to a store object

Open ThaisRobba opened this issue 1 year ago • 2 comments

When using a store with objects and adding new key value pairs, undo (and probably redo) don’t quite work. Oddly enough it works fine if it is used with object signals

Example to reproduce:

const [data, setData, history] = record(createStore({}));

setData({ hello: true }) // This will be pushed to record history

history.undo() // This will move the undo index backwards but not revert the last setData

return <h1>{data.hello.toString()}</h1> // true

ThaisRobba avatar May 22 '23 01:05 ThaisRobba