MCPcopy Index your code
hub / github.com/editablejs/editable / destroy

Method destroy

packages/yjs-websocket/src/index.ts:485–504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

483 }
484
485 destroy() {
486 if (this._resyncInterval !== 0) {
487 clearInterval(this._resyncInterval)
488 }
489 clearInterval(this._checkInterval)
490 this.disconnect()
491 if (typeof window !== 'undefined') {
492 window.removeEventListener('unload', this._unloadHandler)
493 } else if (typeof process !== 'undefined') {
494 process.off('exit', this._unloadHandler)
495 }
496 this.awareness.off('updateV2', this._awarenessUpdateHandler)
497 this.subDocs.forEach(subDoc => {
498 subDoc.off('updateV2', this._updateSubDocHandler)
499 subDoc.destroy()
500 })
501 this.doc.off('subdocs', this._subDocsHandler)
502 this.doc.off('updateV2', this._updateHandler)
503 super.destroy()
504 }
505
506 connectBc() {
507 if (this.disableBc) {

Callers

nothing calls this directly

Calls 2

disconnectMethod · 0.95
offMethod · 0.80

Tested by

no test coverage detected