hi,everyone
I just started learning yjs and I don’t understand how the nodes are related.
const doc1 = new Y.Doc()
let a = doc1.getArray('myarray')
a.insert(0, ['ab','c'])
a.insert(1, ['d'])
I understand it is a linked list structure, but I don’t know what length
means.
I learned from the code that the next clock
is equal to the previous clock+length
clients = {
1: [Item({client: .., clock: 0}, deleted = true), Item({client: .., clock: 1, length: 2}), Item({client: .., clock: 3})]
2: [Item({client: .., clock: 0}), GC({client: .., clock: 1}, length=4)]
}
What is the function of this length
attribute?
Thank you!