-
Notifications
You must be signed in to change notification settings - Fork 15
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
state.undo / redo
does not seem to work
#27
Comments
Hey, thanks for trying the library. |
Hey @dai-shi thanks for the quick response
what did you mean by that ? I can't call undo / redo without |
Yeah, I mean to ask help for debugging. |
I'm somehow familiar with the implementation of |
I'm interested in using valtio-yjs with either proxyWithHistory or y.js' undoManager. Has there been progress on this bug? I tried adding UndoManager usage to this valtio-yjs demo but calling undo did not change the data at all. |
At the moment, I'd say valtio-yjs and proxyWithHistory conflict. (Help wanted) |
@vezwork when I had issues with the yjs undoManager it helped to assign a transaction origin to the undo manager and valtio-yjs. const undoManager = new Y.UndoManager(yMap, {
trackedOrigins: new Set(["valtio"]),
});
bind(syncedStore, yMap, {
transactionOrigin: "valtio",
}); I am not quite sure why this is necessary, but after adding it it worked for me. |
Thanks @PhilGarb, I just tried that but undo still does not seem to do anything. Here is what I was trying: https://codesandbox.io/s/valtio-yjs-demo-forked-2hzskt?file=/src/App.js edit: Never mind! It works! I upgraded the example's version of |
Thanks for the awesome library,
I'm trying to make the undo / redo from valtio's
proxyWithHistory
work but it seems that it is not triggering yjs to update on undo / redo.Code sandbox example here:
https://codesandbox.io/s/valtio-history-counter-d6txif?file=/src/App.js:329-345
any ideas on how to solve this ?
The text was updated successfully, but these errors were encountered: