()
| 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) { |
nothing calls this directly
no test coverage detected