From f604250fc3af79fe1c6fb40a5e309e2f67719f10 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Tue, 10 Sep 2024 15:35:46 +0200 Subject: [PATCH] add `ydoc.isDestroyed` property --- src/utils/Doc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/Doc.js b/src/utils/Doc.js index 62643617..d5165426 100644 --- a/src/utils/Doc.js +++ b/src/utils/Doc.js @@ -104,6 +104,7 @@ export class Doc extends ObservableV2 { * lost (with false as a parameter). */ this.isSynced = false + this.isDestroyed = false /** * Promise that resolves once the document has been loaded from a presistence provider. */ @@ -322,6 +323,7 @@ export class Doc extends ObservableV2 { * Emit `destroy` event and unregister all event handlers. */ destroy () { + this.isDestroyed = true array.from(this.subdocs).forEach(subdoc => subdoc.destroy()) const item = this._item if (item !== null) {