developing #10
|
|
@ -27,16 +27,14 @@ export class CRDTManager {
|
||||||
this.edgesMap = this.doc.getMap('edges')
|
this.edgesMap = this.doc.getMap('edges')
|
||||||
this.callbacks = callbacks
|
this.callbacks = callbacks
|
||||||
|
|
||||||
// Listen for remote Yjs document changes
|
// Schedule persistence on local Yjs document changes
|
||||||
this.nodesMap.observe(() => {
|
this.nodesMap.observe(() => {
|
||||||
if (this.isApplyingRemote) return
|
if (this.isApplyingRemote) return
|
||||||
this.notifyNodesChange()
|
|
||||||
this.schedulePersist()
|
this.schedulePersist()
|
||||||
})
|
})
|
||||||
|
|
||||||
this.edgesMap.observe(() => {
|
this.edgesMap.observe(() => {
|
||||||
if (this.isApplyingRemote) return
|
if (this.isApplyingRemote) return
|
||||||
this.notifyEdgesChange()
|
|
||||||
this.schedulePersist()
|
this.schedulePersist()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue