delete child if parent is deleted

This commit is contained in:
Kevin Jahns
2017-10-26 20:53:17 +02:00
parent 74f9ceab01
commit 5cf8d20cf6
6 changed files with 32 additions and 19 deletions

View File

@@ -29,19 +29,6 @@ export default class DeleteStore extends Tree {
var n = this.findWithUpperBound(id)
return n !== null && n._id.user === id.user && id.clock < n._id.clock + n.len
}
// TODO: put this in function (and all other methods)
applyMissingDeletesOnStruct (struct) {
const strID = struct._id
// find most right delete
let n = this.findWithUpperBound(new ID(strID.user, strID.clock + struct._length - 1))
if (n === null || n._id.user !== strID.user || n._id.clock + n.len <= strID.clock) {
// struct is not deleted
return null
}
// TODO:
// * iterate to the right and apply new Delete's
throw new Error('Not implemented!')
}
/*
* Mark an operation as deleted. returns the deleted node
*/