MCPcopy
hub / github.com/tldraw/tldraw / close

Method close

packages/sync-core/src/lib/TLSyncClient.ts:823–831  ·  view source on GitHub ↗

* Closes the sync client and cleans up all resources. * * Call this method when you no longer need the sync client to prevent * memory leaks and close the WebSocket connection. After calling close(), * the client cannot be reused. * * @example * ```ts * // Clean shutdown * syncClie

()

Source from the content-addressed store, hash-verified

821 * ```
822 */
823 close() {
824 this.debug('closing')
825 this.disposables.forEach((dispose) => dispose())
826 this.sendUnsentChanges.cancel?.()
827 this.scheduleRebase.cancel?.()
828 if (typeof window !== 'undefined' && (window as any).tlsync === this) {
829 delete (window as any).tlsync
830 }
831 }
832
833 private lastPushedPresenceState: R | null = null
834

Callers 3

constructorMethod · 0.95
makeTestInstanceFunction · 0.95
useSyncFunction · 0.95

Calls 4

debugMethod · 0.95
cancelMethod · 0.65
disposeFunction · 0.50
forEachMethod · 0.45

Tested by 1

makeTestInstanceFunction · 0.76