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

Function confirmOperationsSync

packages/db/src/local-only.ts:359–375  ·  view source on GitHub ↗
(mutations: Array<PendingMutation<T>>)

Source from the content-addressed store, hash-verified

357 * @param mutations - Array of mutation objects from the transaction
358 */
359 const confirmOperationsSync = (mutations: Array<PendingMutation<T>>) => {
360 if (!syncBegin || !syncWrite || !syncCommit) {
361 return // Sync not initialized yet, which is fine
362 }
363
364 // Immediately write back through sync interface
365 syncBegin()
366 mutations.forEach((mutation) => {
367 if (syncWrite) {
368 syncWrite({
369 type: mutation.type,
370 value: mutation.modified,
371 })
372 }
373 })
374 syncCommit()
375 }
376
377 return {
378 sync,

Callers

nothing calls this directly

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected