If my server previously had
- a simple Revision “clock” for each document (an integer that counts up on every change saved to the server since that instance of it started), and
- replies to HTTPS PUT request to save document changes with the new Revision, which is used in the HTTPs callback,
how would I mock that up with Yjs?
I can deepObserve my Y.Array of Y.Map objects, make my changes in a transasaction, and respond to any change on the server by writing the new data to the server “wiki”.
I could then call myYMap.set(‘revision’,newRevision) from within the server handler. This change would then be picked up by the Client deepObserver…
but that seems fragile… and how would I use this logic within a node.js style callback-chain, where I now have to return the new revision or any error to the next callback?