implement snapshot & event.changes

This commit is contained in:
Kevin Jahns
2019-09-03 16:33:29 +02:00
parent 8bcff6138c
commit bb1c0b809f
9 changed files with 319 additions and 29 deletions

View File

@@ -584,7 +584,7 @@ export const typeMapHas = (parent, key) => {
*/
export const typeMapGetSnapshot = (parent, key, snapshot) => {
let v = parent._map.get(key) || null
while (v !== null && (!snapshot.sm.has(v.id.client) || v.id.clock >= (snapshot.sm.get(v.id.client) || 0))) {
while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {
v = v.left
}
return v !== null && isVisible(v, snapshot) ? v.content.getContent()[v.length - 1] : undefined