listen for map changes

This commit is contained in:
Philipp Kühn
2021-02-12 11:00:23 +01:00
parent 92d5b073ae
commit 41cb9924e5
2 changed files with 27 additions and 10 deletions

View File

@@ -19,11 +19,6 @@ export class AnnotationState {
constructor(options: AnnotationStateOptions) {
this.options = options
// TODO: Observe Y.js changes and re-render decorations
// this.options.map.observe(e => {
// console.log('e', e)
// })
}
findAnnotation(id: string) {
@@ -113,6 +108,12 @@ export class AnnotationState {
this.deleteAnnotation(action.id)
}
// @ts-ignore
if (action.type === 'updateAnnotations') {
console.log('updateAnnotations!')
this.updateDecorations(state)
}
return this
}