From 9c9546e9cb22d5e727445daf3df90421216c7139 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 11 Aug 2023 16:01:53 +0000 Subject: [PATCH] watch source while debug --- packages/frontend/src/scripts/entity-manager.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/scripts/entity-manager.ts b/packages/frontend/src/scripts/entity-manager.ts index b09d1c3cd5..cb7f121054 100644 --- a/packages/frontend/src/scripts/entity-manager.ts +++ b/packages/frontend/src/scripts/entity-manager.ts @@ -144,7 +144,13 @@ export class NoteManager { if (this.isDebuggerEnabled) console.log('NoteManager: set note (update)', note.id, cached, note); } else { this.notesSource.value.set(note.id, note); - if (this.isDebuggerEnabled) console.log('NoteManager: set note (new)', note.id, this.notesSource.value.get(note.id), note); + + if (this.isDebuggerEnabled) { + console.log('NoteManager: set note (new)', note.id, { src: note, ref: this.notesSource.value.get(note.id) }); + watch(this.notesSource.value.get(note.id)!, newVal => { + console.log('NoteManager: note source updated', newVal.id, newVal); + }); + } } this.updatedAt.set(note.id, Date.now()); }