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

transform result not right when transform two delta only contain retain. #66

Closed
xlcs0110 opened this issue May 18, 2021 · 1 comment
Closed

Comments

@xlcs0110
Copy link

new Delta().retain(1).insert({b:2}).transform(new Delta().retain(1).retain(1,{a:1}),**false**)
// result is new Delta().retain(2).retain(1,{a:1})

new Delta().retain(1).insert({b:2}).transform(new Delta().retain(1).retain(1,{a:1}),**true**)
// result is new Delta().retain(2).retain(1,{a:1}) too.

but when delta contain "insert"
new Delta().retain(1).insert({b:2}).transform(new Delta().retain(1).insert({a:1}),**false**)
//result is new Delta().retain(1).insert({a:1})

new Delta().retain(1).insert({b:2}).transform(new Delta().retain(1).insert({a:1}),**true**)
//result is new Delta().retain(2).insert({a:1})

why the result of new Delta().retain(1).insert({b:2}).transform(new Delta().retain(1).retain(1,{a:1}),**false**) is not new Delta().retain(1).retain(1,{a:1}) too.

@jhchen
Copy link
Member

jhchen commented May 19, 2021

This is how transform for Operational Transform works. There are resources online that explains the what and why but this library just implements that. If you still think there's an error please elaborate on your rationale.

@jhchen jhchen closed this as completed May 19, 2021
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