Skip to content

Commit f604250

Browse files
committed
add ydoc.isDestroyed property
1 parent 7422b18 commit f604250

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/Doc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export class Doc extends ObservableV2 {
104104
* lost (with false as a parameter).
105105
*/
106106
this.isSynced = false
107+
this.isDestroyed = false
107108
/**
108109
* Promise that resolves once the document has been loaded from a presistence provider.
109110
*/
@@ -322,6 +323,7 @@ export class Doc extends ObservableV2 {
322323
* Emit `destroy` event and unregister all event handlers.
323324
*/
324325
destroy () {
326+
this.isDestroyed = true
325327
array.from(this.subdocs).forEach(subdoc => subdoc.destroy())
326328
const item = this._item
327329
if (item !== null) {

0 commit comments

Comments
 (0)