YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
https://syncedstore.org
MIT License
1.71k stars 51 forks source link

Undo Redo Support #78

Closed websiddu closed 1 year ago

websiddu commented 1 year ago

Is there a way to do undo/redo using Synced Store?

YousefED commented 1 year ago

Yes @websiddu ! You should be able to use the regular Yjs undomanager, e.g.:

const val = getYjsValuestore.value)

const undoManager = new Y.UndoManager(val)

// Do stuff to val (Let undoManager capture the updates)

undoManager.undo() // Revert the captured updates

Does this answer your question?