Skip to content
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

Is there any way to merge multiple op's between any two versions? #549

Open
Xheldon opened this issue Mar 7, 2022 · 1 comment
Open

Comments

@Xheldon
Copy link

Xheldon commented Mar 7, 2022

For intance, a docs have three version, A ,B, C
A contents is : github
B content is: gb
C content is: gitbit
thus there has two ops:

A ---delete text(delete 'ithb')---> B ---insert text(add 'it' after 'g' and add 'it' after 'b')---> C

So, is there any way to get the merged ops between version a to version c? The merged op above should be:

A ---delete text (delete 'hu') & insert text (add 'it' after 'b') ---> C

Any help are welcome!

@alecgibson
Copy link
Collaborator

You'll want to use backend.getOps() to get the appropriate ops.

Then you can use your type's compose() method to merge the ops together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants