MCPcopy Index your code
hub / github.com/TanStack/db / touchCollection

Method touchCollection

packages/db/src/transactions.ts:438–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

436
437 // Tell collection that something has changed with the transaction
438 touchCollection(): void {
439 const hasCalled = new Set()
440 for (const mutation of this.mutations) {
441 if (!hasCalled.has(mutation.collection.id)) {
442 mutation.collection._state.onTransactionStateChange()
443
444 // Only call commitPendingTransactions if there are pending sync transactions
445 if (mutation.collection._state.pendingSyncedTransactions.length > 0) {
446 mutation.collection._state.commitPendingTransactions()
447 }
448
449 hasCalled.add(mutation.collection.id)
450 }
451 }
452 }
453
454 /**
455 * Commit the transaction and execute the mutation function

Callers 2

rollbackMethod · 0.95
commitMethod · 0.95

Calls 3

hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected