Skip to content

Combination of proxyWithHistory and subscribe #506

Closed Answered by dai-shi
LukasSchwarz4202 asked this question in Q&A
Discussion options

You must be logged in to vote

undo() will replace keyValueProxy.value with a new object, so you have to subscribe to keyValueProxy to get notified with undo.
https://codesandbox.io/s/valtio-subscribe-proxywithhistory-forked-uk394m
(If you need to track some specific properties, you would need to keep the previous value and compare.)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LukasSchwarz4202
Comment options

Answer selected by LukasSchwarz4202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants