Open nnseva opened 4 years ago
The reason it works this way is so operations can be inverted, which makes many features like undo easy to implement. I’m not sure about the state of the codebase now, but for a time the code would function just fine the way you suggest too. (It doesn’t need to know what content was deleted to support compose/transform/apply.)
Let's imagine that the data contains a very big branch, f.e.
{key: {a:1,b:2,...,z:27}, other:...}
We are going to delete the whole branch "key" for some reason. As I understand, the operation then should look like
{p:["key"], od:{a:1,b:2,...,z:27}}
.But for the delete operation, the logically required information is the only key of the deleted item. The deleted object content is the extra info which is not necessary for the operation.
It was probably useful to exclude repeating object content for the delete operation and replace it by something neutral, like logical
true
.{p:["key"], od:true}
It looks much more compact and logical.