MCPcopy Create free account
hub / github.com/TanStack/db / cleanup

Method cleanup

packages/db/src/collection/state.ts:1423–1439  ·  view source on GitHub ↗

* Clean up the collection by stopping sync and clearing data * This can be called manually or automatically by garbage collection

()

Source from the content-addressed store, hash-verified

1421 * This can be called manually or automatically by garbage collection
1422 */
1423 public cleanup(): void {
1424 this.syncedData.clear()
1425 this.syncedMetadata.clear()
1426 this.syncedCollectionMetadata.clear()
1427 this.optimisticUpserts.clear()
1428 this.optimisticDeletes.clear()
1429 this.pendingOptimisticUpserts.clear()
1430 this.pendingOptimisticDeletes.clear()
1431 this.pendingOptimisticDirectUpserts.clear()
1432 this.pendingOptimisticDirectDeletes.clear()
1433 this.clearOriginTrackingState()
1434 this.isLocalOnly = false
1435 this.size = 0
1436 this.pendingSyncedTransactions = []
1437 this.syncedKeys.clear()
1438 this.hasReceivedFirstCommit = false
1439 }
1440}

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45

Tested by

no test coverage detected